Bug ID 444178: HTTP header replace always inserts header

Last Modified: Sep 13, 2023

Affected Product(s):
BIG-IP LTM(all modules)

Known Affected Versions:
11.4.0, 11.4.1, 11.5.0, 11.5.1

Fixed In:
11.6.0, 11.5.2, 11.4.1 HF4

Opened: Jan 16, 2014

Severity: 3-Major

Related Article: K15371

Symptoms

Setting up a Policy to replace HTTP header results in both the existing and new header values appearing instead of the expected behavior of replacing an existing header with a new one. The following example which attempts to replace the Server: header with a generic "AnonymousServer" demonstrates this. In this example, one would observe the response containing two Server: headers. ltm policy /Common/replace_server { controls { response-adaptation } requires { http } rules { replace_a_header { actions { 0 { http-header response replace name Server value AnonymousServer } } conditions { 0 { http-header response name Server starts-with values { Apache } } } ordinal 1 } } strategy /Common/first-match }

Impact

This can result in duplicate values for the specified HTTP headers.

Conditions

This replacement header specified in the Policy is inserted under all conditions.

Workaround

Can employ a custom iRule to achieve equivalent result. Below is an example of an iRule to replace the User-Agent header: when HTTP_REQUEST { set useragent [HTTP::header value User-Agent] if {$useragent contains "Mozilla"} { HTTP::header replace User-Agent "MMMMMMMMM" } }

Fix Information

The policy will properly replace specified HTTP headers.

Behavior Change

Guides & references

K10134038: F5 Bug Tracker Filter Names and Tips