httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Richards <>
Subject [users@httpd] CGI response using chunked Transfer-Encoding, Apache erroneously adding Content-Length
Date Sat, 03 Sep 2005 21:17:35 GMT
I'm attempting to write a CGI script response which has the
Transfer-Encoding header set to "cunked".  Apache is buffering the
output and erroneously adding a Content-Length header which is
forbidden by the HTTP spec [1].

Does anyone know of a way to fix this problem and generate a real
chunked response from CGI?  Below are some more details.

[ Here is the output my CGI script is giving to apache ]
Transfer-Encoding: chunked
Content-type: text/plain

Hello World
Hello World
Hello World

[ Here is a sample request I can make manually using telnet ]
GET /~pauldoo/cgi-bin/ HTTP/1.1
Host: localhost

[ And finally here is the response apache gives, note the Content-Length ]
HTTP/1.1 200 OK
Date: Sat, 03 Sep 2005 21:06:46 GMT
Server: Apache/2.0.54 (Unix) mod_ssl/2.0.54 OpenSSL/0.9.7g-fips DAV/2
Transfer-Encoding: chunked
Content-Length: 44
Content-Type: text/plain

Hello World
Hello World
Hello World

[1] section 4.4:
"Messages MUST NOT include both a Content-Length header field and a
non-identity transfer-coding. If the message does include a
non-identity transfer-coding, the Content-Length MUST be ignored."

Paul Richards

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message