Configuring the HTML Injection feature to insert data into the HTTP header.
Summary
To configure HTML Injection to insert data in the HTTP header, set the parameters as described in the sections that follow.
The following procedure describes the steps to insert a unique transaction ID into every HTTP response. HTML Injection is configured so that the transaction ID persists across reboots and system upgrades.
Injecting Data into the HTTP Header
In this example, we will create a filter action to insert the system variable %%HTTP.XID%% into a custom HTTP header X-HTTP-REQ-ID. The variable assigns a unique ID to each transaction. After creating the filter action, you can use an external server to extract the value of the custom HTTP header and track the unique transaction ID of each HTTP response.You can use the filter action to create a filter policy that inserts the ID into the response header for every transaction. This policy can then be bound to any point on the system.
Creating Filter Actions
To create filter actions, use the parameters listed in the following table.
Parameter |
Description |
| Action Name |
The name of the filter action. This is a mandatory parameter and cannot be changed. The name must not exceed 32 characters |
Qualifier |
Select the type of filter action being performed. The following filter actions can be configured
- Reset
- Add
- Corrupt
- Forward
- ErrorCode
- Drop
|
Value |
Specify the value to be inserted. This parameter is active only when you select the Add qualifier. If the value parameter is not set, then the contents of the HTTP Header text box are inserted. The following values can be configured
Prebody - Inserts the contents of the configured prebody file into the HTTP response
Postbody - Inserts the contents of the configured postbody file into the HTTP response |
| HTTP Header |
The data to be inserted into the HTTP header. This field is active only if neither prebody nor postbody injection is configured. |
The following procedure describes the steps to create a filter action, Action-Filter-1 to insert the system variable %%HTTP.XID%% into the custom HTTP header X-HTTP-REQ-ID.
To add a Filter Action
- In the left pane, expand Protection Features, then click Filter. The Filter page appears in the right pane.
- Click the Actions tab.
- Click Add. The Create Filter Action dialog box appears.
- In the Action Name text box, type the name of the Filter Action, for example, Action-Filter-1.
- Under Qualifier, choose the type of qualifier, for example, Add.
- In the HTTP Header text box, name of the custom header, followed by a colon, then the system variable that will insert text in the HTTP header. For example X-HTTP-REQ-ID:%%HTTP.XID%%.
- Click Create, then click Close. The filter action Action-Filter-1 that you created now appears in the Filter Actions page..
More Information