HTTP header fields of inbound HTTP requests and outbound HTTP responses can be modified. You can delete, add, or enhance (with additional values) HTTP header fields of inbound HTTP requests. HTTP responses can be modified too. A line in the action file describes precisely one modification action. The sequence in the action file defines the sequence of execution too. You can execute multiple HTTP header field modifications consecutively.
Use the following syntax to define HTTP header field modifications in the action file:
<headerop> <name> [<value>]
Use the following syntax for RegRewriteHeader and RegIRewriteHeader.
<headerop> <name> <Wert vor der Modifikation> <Wert nach der Modifikation>
Use the following syntax for RegRewriteResponseHeader and RegIRewriteResponseHeader.
<headerop> <name> <pattern> <value>
Only RegRewriteHeader or RegIRewriteHeader and RegRewriteResponseHeader or RegIRewriteResponseHeader are case-sensitive. All other HTTP header field modifications are case-insensitive.
Explanation of the Syntax
<headerop> |
Describes an HTTP header field modification. The following HTTP header field modifications are possible: HTTP Requests:
HTTP Responses:
|
<name> |
Name of the HTTP header field. |
<value> |
With HTTP header field modifications AppendHeader, AppendRespondHeader, RegRewriteResponseHeader, RegIRewriteResponseHeader, SetHeader, SetHeaderIfEmpty, SetResponseHeader, and SetResponseHeaderIfEmpty, you specify the value <value> that is to be set or appended depending on the <headerop> defined. |
The matrix below shows the various HTTP header field modifications:
Example A:
headerop |
Header not set |
Header set a = 5 |
SetHeader location 100 |
location = 100 |
location = 100 |
SetHeaderIfEmpty location 100 |
location = 100 |
location = 5 |
AppendHeader location 100 |
location = 100 |
location = 5, 100 |
Below are examples of HTTP header field modifications in the action file:
Example B:
SetHeader clientProtocol %{SERVER_PROTOCOL}
HTTP header field <name> clientProtocol is set to value <value> of variable SERVER_PROTOCOL.
Example C:
SetHeader X-SAP-WEBDISP-AP %{SERVER_ACCESS_POINTS}
HTTP header field <name> X-SAP-WEBDISP-AP is set to the value of variable <value> SERVER_ACCESS_POINTS.
Example D:
RemoveHeader Referer
HTTP header field <Referer> is removed.
RemoveCookie MeinCookieName
Before the rewrite:
cookie: $Version=1; MeinCookieName=Wert
After the rewrite:
cookie: $Version=1
RemoveCookie Mein*Name
Before the rewrite:
cookie: $Version=1; MeinErsterCookieName=MeinErsterWert; MeinZweiterCookieName=MeinZweiterWert
After the rewrite:
cookie: $Version=1
RemoveCookie *SAP*
Before the rewrite:
cookie: $Version=1; sap-login-XSRF_ABC=123456789; sap-userkontext=(...); MeinBevorzugtesUnternehmen=SAP
After the rewrite:
cookie: $Version=1; MeinBevorzugtesUnternehmen=SAP
RegRewriteHeader my_header abc 123
Before the rewrite:
my_header: abc
After the rewrite:
my_header: 123
RegIRewriteHeader Accept (.*)text/html;q=\.[0-9](.*) $1text/html;q=0.1$2
Before the rewrite:
Accept: text/html;q=0.8
After the rewrite:
Accept: text/html;q=0.1