Bug 62197

Summary: A HTTP 200 is returned for proxy requests with truncated headers
Product: Apache httpd-2 Reporter: Hank Ibell <hwibell>
Component: mod_proxy_httpAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: NEW ---    
Severity: normal CC: cbarbara
Priority: P2    
Version: 2.5-HEAD   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X 10.1   

Description Hank Ibell 2018-03-20 16:02:07 UTC
Headers in a proxy response that are greater than 8K are truncated, but still returns a 200.

As header data is being lost, I would expect a HTTP 500 response instead of a 200.

In the example below, a 200 is being returned even though ~1000 bytes are being lost from X-Test-Header-1.

Sample config:
<VirtualHost *:80>
  ProxyPass "/test" "http://localhost:8080"
  ProxyPassReverse "/test" "http://localhost:8080"
</VirtualHost>

<VirtualHost *:8080>
  Header set X-Test-Header-1 "AAAAAAAAAAAAAAA..." # large header > 8KB
</VirtualHost>

Request/response:
$ curl -sD - http://localhost/test -o /dev/null
HTTP/1.1 200 OK
Date: Tue, 20 Mar 2018 15:46:37 GMT
Server: Apache/2.5.1-dev (Unix)
Last-Modified: Sun, 06 Nov 2016 05:34:43 GMT
ETag: "2d-5409b43abe2c0"
Accept-Ranges: bytes
Content-Length: 45
X-Test-Header-1: AAAA... [truncated]
Content-Type: text/html

Original header size:
$ curl -sD - http://localhost:8080 -o /dev/null | grep X-Test-Header-1 | wc -c
    9020

Proxied header size:
$ curl -sD - http://localhost/test -o /dev/null | grep X-Test-Header-1 | wc -c
    8019