DataScript: avi.http.hostname
DataScript
Function | avi.http.hostname() |
Description | Returns the host name from the request. This field could be learned from the following sources, in the following order of precedence:
NOTE: Host name does not include the port, even in case of a request line or host header of the form hostname:port |
Events | HTTP_REQ HTTP_RESP |
Parameter | None |
Returns | String of the hostname requested by the client. It does not include the port. |
Example 1 | If there is no host name, close the TCP connection.
|
Example 2 | Rewrite the location header for relative redirects to absolute, while changing them to HTTPS. This DataScript should be applied to the HTTP Response event. The rewritten headers should look like:
|
Note: This API is not supported in the events SSL_PRECONNECT
, SSL_CLIENTHELLO
, and SSL_HANDSHAKE_DONE
.