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.
Do you send the content as well?
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
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 -------------------------------
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.
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.
Can you attach a small PHP script to reproduce the problem? Thanks.
No response from submitter. Assuming invalid.
Created attachment 15084 [details] PHP script that reproduces bug
I'm finding this, too. Content-Length header shows up both for HEAD and GET requests in Apache 1.3.
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 ***