httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Richards <paul.richa...@gmail.com>
Subject [users@httpd] CGI response using chunked Transfer-Encoding, Apache erroneously adding Content-Length
Date Sat, 03 Sep 2005 21:17:35 GMT
Hi,
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

b
Hello World
b
Hello World
b
Hello World
0

[ Here is a sample request I can make manually using telnet ]
GET /~pauldoo/cgi-bin/tunnel.py 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

b
Hello World
b
Hello World
b
Hello World
0


[1] http://www.ietf.org/rfc/rfc2616.txt 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:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message