Bug 28571 - HEAD type request and Content-Length header into responce
Summary: HEAD type request and Content-Length header into responce
Status: RESOLVED DUPLICATE of bug 18757
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: All (show other bugs)
Version: 2.0.49
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-24 20:38 UTC by Rin
Modified: 2005-10-28 10:26 UTC (History)
0 users



Attachments
PHP script that reproduces bug (188 bytes, text/plain)
2005-05-20 06:33 UTC, Kevin Dorne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rin 2004-04-24 20:38:43 UTC
My script by PHP always send "Content-Length" header.
If I send request with GET method, I see "Content-Length" header, but if I send 
request with HEAD method, I can't see it.
Apache 1.3.x always return "Content-Length" header -- and this is true.
Comment 1 André Malo 2004-04-24 20:50:34 UTC
Do you send the content as well?
Comment 2 Rin 2004-04-24 21:09:34 UTC
Yes, as well.

------------------

Request:
GET http://127.0.0.1/pgcms2/public_html/

Response:
date Sat, 24 Apr 2004 21:01:43 GMT 
server Apache/2.0.49 (Win32) PHP/4.3.6 
x-powered-by ProgressCMS/2.0.1 (benchmark=0.0206;compress_ratio=37%) 
expires Sat, 24 Apr 2004 20:25:35 GMT 
cache-control public 
pragma public 
last-modified Sat, 24 Apr 2004 20:25:32 GMT 
etag "bb6ed991c1da918a06cd428b4e8c0de5" 
content-encoding gzip 
vary Accept-Encoding 
content-length 3003 
connection close 
content-type text/html; charset=windows-1251 

Request:
HEAD http://127.0.0.1/pgcms2/public_html/

Response:
date Sat, 24 Apr 2004 21:04:00 GMT 
server Apache/2.0.49 (Win32) PHP/4.3.6 
x-powered-by ProgressCMS/2.0.1 (benchmark=0.0213;compress_ratio=37%) 
expires Sat, 24 Apr 2004 20:25:35 GMT 
cache-control public 
pragma public 
last-modified Sat, 24 Apr 2004 20:25:32 GMT 
etag "bb6ed991c1da918a06cd428b4e8c0de5" 
content-encoding gzip 
vary Accept-Encoding 
connection close 
content-type text/html; charset=windows-1251 

------------------

For HEAD method "content-length 3003" can't see
Comment 3 Rin 2004-04-24 21:18:30 UTC
For Apache/1.3.28 tests:
~~~~~~~~~~~~~~~~~~~~~~~~

-------------------------------

Request:
GET http://127.0.0.1/pgcms2/public_html/

Response:
date Sat, 24 Apr 2004 21:15:21 GMT 
server Apache/1.3.28 (Win32) PHP/4.3.6 
x-powered-by ProgressCMS/2.0.1 (benchmark=0.0197;compress_ratio=37%) 
expires Sat, 24 Apr 2004 20:25:35 GMT 
cache-control public 
pragma public 
last-modified Sat, 24 Apr 2004 20:25:32 GMT 
etag "bb6ed991c1da918a06cd428b4e8c0de5" 
content-encoding gzip 
vary Accept-Encoding 
content-length 3003 
connection close 
content-type text/html; charset=windows-1251 


Request:
HEAD http://127.0.0.1/pgcms2/public_html/

Response:
date Sat, 24 Apr 2004 21:18:19 GMT 
server Apache/1.3.28 (Win32) PHP/4.3.6 
x-powered-by ProgressCMS/2.0.1 (benchmark=0.0208;compress_ratio=37%) 
expires Sat, 24 Apr 2004 20:25:35 GMT 
cache-control public 
pragma public 
last-modified Sat, 24 Apr 2004 20:25:32 GMT 
etag "bb6ed991c1da918a06cd428b4e8c0de5" 
content-encoding gzip 
vary Accept-Encoding 
content-length 3003 
connection close 
content-type text/html; charset=windows-1251 

-------------------------------
Comment 4 André Malo 2004-04-24 22:05:28 UTC
Ah, my question was, if you send the whole content also on HEAD requests (not
only the content length). You need to do in Apache 2, because it deals with it
automatically. You should not care about GET or HEAD. Just treat all such
requests as GET.
Comment 5 Rin 2004-04-24 23:26:26 UTC
I undestand you.
Yes, I send whole content on GET and HEAD method.
For example, I have written my full tests above.
I think, what Apache 2 don't work true with "content-length" header.
True in Apache 1.3.x
Probably, I do mistake, just it's my opinion.
---
Best regards, Rin, Russia.
Comment 6 André Malo 2004-04-26 17:38:20 UTC
Can you attach a small PHP script to reproduce the problem?
Thanks.
Comment 7 Joshua Slive 2004-07-12 18:27:19 UTC
No response from submitter.  Assuming invalid.
Comment 8 Kevin Dorne 2005-05-20 06:33:40 UTC
Created attachment 15084 [details]
PHP script that reproduces bug
Comment 9 Kevin Dorne 2005-05-20 06:36:36 UTC
I'm finding this, too.  Content-Length header shows up both for HEAD and GET
requests in Apache 1.3.
Comment 10 Joe Orton 2005-10-28 18:26:15 UTC
This is the same problem as the issue for the proxy; the content-length filter
will unnecessarily strip the response Content-Length for responses to HEAD.

Greg's fix for 18757 fixes PHP too.


*** This bug has been marked as a duplicate of 18757 ***