Bug ID 692310: ICAP modified HTTP 1.1 request/response without content-length gets "chunked" even with no body

Last Modified: Oct 06, 2020

Bug Tracker

Affected Product:  See more info
BIG-IP LTM(all modules)

Known Affected Versions:
13.0.0, 13.0.0 HF1, 13.0.0 HF2, 13.0.0 HF3, 13.0.1, 13.1.0, 13.1.0.1, 13.1.0.2, 13.1.0.3, 13.1.0.4, 13.1.0.5, 13.1.0.6, 13.1.0.7

Fixed In:
14.0.0, 13.1.0.8

Opened: Nov 02, 2017
Severity: 3-Major
Related AskF5 Article:
K69250459

Symptoms

When a modified HTTP v1.1 request or response is returned from an ICAP server and has no body (and also no content-length), a 'Transfer-Encoding: chunked' header is added and a zero-length chunk is appended.

Impact

The HTTP server or client to which the modified request or response is destined, receives invalid HTTP and might behave in an unexpected manner.

Conditions

-- HTTP profile. -- Either request-adapt or response-adapt profile. -- Modified HTTP v1.1 request/response has no body (and no content-length header).

Workaround

Use an iRule to detect the lack of a Content-Length header in the modified request or response, and insert 'Content-Length: 0'. For example with modified request: when ADAPT_REQUEST_HEADERS { if {([HTTP::method] eq "GET") and (not [HTTP::header exists 'Content-Length'])} { HTTP::header insert Content-Length 0 } } Similarly when ADAPT_RESPONSE_HEADERS {} for a response.

Fix Information

A modified HTTP v1.1 request or response with no body is never 'chunked'.

Behavior Change