Show TOC

Background documentationUsing Variables in HTTP Request Modifications Locate this document in the navigation structure

 

You can use variables in HTTP request modifications. While modification actions are being executed in the action file, HTTP request values and system information can be queried.

Structure

Use the following syntax to use variables in the action file:

Syntax Syntax

  1. %{Variable}
End of the code.

Integration

Below are examples of the use of variables:

Syntax Syntax

  1. SetHeader clientProtocol %{SERVER_PROTOCOL}
End of the code.

The header field clientProtocol is set to the value of the variable SERVER_PROTOCOL

Syntax Syntax

  1. SetHeader X-SAP-WEBDISP-AP %{SERVER_ACCESS_POINTS}
End of the code.

The header field X-SAP-WEBDISP-AP is set to the value of the variable SERVER_ACCESS_POINTS

Syntax Syntax

  1. if %{REQUEST_METHOD} !stricmp "GET" [AND]
    if %{REQUEST_METHOD} !stricmp "POST"
    RegForbiddenURL ^/(.*) –
    
End of the code.

Only data sent with the GET or POST method is allowed: If the data is not sent with GET or POST, HTTP status code 403 (forbidden) is returned as the response to the HTTP client.

Syntax Syntax

  1. if %{HTTP_HOST} regimatch ldp*
    RegIRewriteUrl ^/ping(.*) /sap/public/icman/ping$1
    
End of the code.

If the host name (value of variable HTTP_HOST) starts with ldp*, the /ping in URLs that start with /ping is replaced with /sap/public/icman/ping.

Features

Supported Variables

The following variables are supported:

Access to Header Fields

Variable name

HTTP Header Field

HTTP_USER_AGENT

User Agent

HTTP_REFERER

Referer

HTTP_COOKIE

Cookie

HTTP_FORWARDED

Forwarded

HTTP_HOST

Host

HTTP_CONTENT_LENGTH

Content Length

HTTP_CONTENT_TYPE

Content Type

HTTP_ACCEPT

Accept

HTTP_ACCEPT_CHARSET

Accept Charset

HTTP_ACCEPT_ENCODING

Accept Encoding

HTTP_ACCEPT_LANGUAGE

Accept Language

HTTP_VIA

Via

HEADER:<name>

Any header field with a <name>. The name is case insensitive.

Access to Request URL

Variable name

Attribute of Request, Possible Values

REQUEST_METHOD

Method used: GET, POST, PUT, HEAD, ...

SERVER_PROTOCOL

Log: http, https

PATH

URL decoded path of request

PATH_TRANSLATED

Standardized URL decoded path of request

QUERY_STRING

List of form fields after the '?'

FORMFIELD:<name>

Value of form field with <name>.

The field name comparison is case insensitive

FormField:<name>

Value of form field with <name>.

The field name comparison is case sensitive

Standard Request Values

Variable name

Attribute of Request, Possible Values

SERVER_PORT

Port number where request was received

SERVER_ADDR

IP address of the server where request was received

REMOTE_HOST, REMOTE_ADDR

IP address of the remote host

REMOTE_PORT

Port number of the remote host

SERVER_ACCESS_POINTS

Server accessibility (usually for the header field "X-SAP-WEBDISP-AP").

SERVER_ACCESS_POINTS = http:80,https:8443

SSL-Specific Values

These values are available only for an HTTPS connection if the client has also sent an X.509 client certificate:

Variable name

Attribute of Request, Possible Values

SSL_CLIENT_CERT

Base64-coded client certificate

SSL_CLIENT_CERT_SUBJECT

Contains the subject field of the client certificate

SSL_CLIENT_CERT_ISSUER

Contains the issuer field of the client certificate

SSL_CLIENT_CERT_CHAIN_0... SSL_CLIENT_CERT_CHAIN_n

CHAIN_0: This is the first NON root-CA certificate of the CA that the client certificate has signed (also Base64 coded).

CHAIN_n: This is the last NON root-CA certificate of the CA that the client certificate has signed (also Base64 coded).

SSL_CIPHER_USEKEYSIZE

Number of cipher bits used

SSL_CIPHER_SUITE

Cipher suite used after the SSL (draft-free-ssl-version3-02) and TLS (RFC 2246) specification.

System Values

Variable name

Value

SERVER_SOFTWARE

Name of the Web server

SERVER_NAME

Default name of the HTTP server

TIME_YEAR

Current year

TIME_MON

Current month (values from 1 to 12)

TIME_DAY

Current day

TIME_HOUR

Current hour (values from 0 to 23)

TIME_MIN

Current minute (values from 0 to 59)

TIME_SEC

Current second (values from 0 to 59)

TIME_WDAY

Current day of the week (values from Monday=0 to 6)

TIME

Current time in seconds since 1970