You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2006/12/26 17:56:04 UTC
DO NOT REPLY [Bug 41245] New: - Apache2 sends wrong status code with "Not modified" response.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41245>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=41245
Summary: Apache2 sends wrong status code with "Not modified"
response.
Product: Apache httpd-2
Version: 2.0.54
Platform: PC
OS/Version: Linux
Status: NEW
Severity: minor
Priority: P2
Component: mod_cgi
AssignedTo: bugs@httpd.apache.org
ReportedBy: claus@faerber.name
If a CGI script sends a "Status: 200 OK" header along with a valid
"Last-Modified" header, Apache2 sends the 200 status code along with the
truncated response if the browser sends a matching "If-Modified-Since" header.
Apache2 should also modify the status code to 304 if it truncates the response.
As a workaround, one can remove the "Status: 200 OK" line from the CGI response.
Example CGI script (any POSIX-compatible host):
---
#!/bin/sh
cat <<__EOF__
Status: 200 OK
Content-Type: text/html; charset=UTF-8
Last-Modified: Tue, 26 Dec 2006 12:00:00 GMT
BOO!
__EOF__
---
Example Ethereal trace (with IE 7, host name changed):
---
GET /test.cgi HTTP/1.1
Accept: */*
Accept-Language: de
UA-CPU: x86
Accept-Encoding: gzip, deflate
If-Modified-Since: Tue, 26 Dec 2006 12:00:00 GMT
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR
1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; Media Center PC 4.0)
Host: www.example.org
Connection: Keep-Alive
---
HTTP/1.0 200 OK
Date: Tue, 26 Dec 2006 16:47:53 GMT
Server: Apache/2.0.54 (Debian GNU/Linux) mod_auth_pgsql/2.0.2b1
mod_ldap_userdir/1.1.7 PHP/4.3.10-18 mod_ssl/2.0.54 OpenSSL/0.9.7e
mod_perl/1.999.21 Perl/v5.8.4
Connection: close
---
The response should say "HTTP/1.1 304 Not modified"
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 41245] - Apache2 sends wrong status code with "Not modified" response.
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41245>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=41245
nick@webthing.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |FIXED
------- Additional Comments From nick@webthing.com 2006-12-26 12:05 -------
You're using an old Apache version. It was fixed on Feb. 4th.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 41245] - Apache2 sends wrong status code with "Not modified" response.
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41245>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=41245
------- Additional Comments From claus@faerber.name 2006-12-26 09:05 -------
I forgot to mention that the correct status code is written to the log:
---
p54973b57.dip0.t-ipconnect.de - - [26/Dec/2006:17:47:53 +0100] "GET /test.cgi
HTTP/1.1" 304 - "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR
1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; Media Center PC 4.0)"
---
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 41245] - Apache2 sends wrong status code with "Not modified" response.
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41245>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=41245
------- Additional Comments From nick@webthing.com 2006-12-26 12:09 -------
(In reply to comment #4)
> You're using an old Apache version. It was fixed on Feb. 4th.
>
I suppose I should've given references for that:
Fixed in:
trunk: http://svn.apache.org/viewcvs?rev=370692&view=rev
2.0: http://svn.apache.org/viewcvs?rev=374894&view=rev
2.2: http://svn.apache.org/viewcvs?rev=374895&view=rev
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 41245] - Apache2 sends wrong status code with "Not modified" response.
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41245>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=41245
claus@faerber.name changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|INVALID |
------- Additional Comments From claus@faerber.name 2006-12-26 11:35 -------
Regardless of what a non-official draft specification says, the server must not
remove header fields (such as "Last-Modified" and "Content-Type") and keep the
status code. By doing this, Apache2 _does_ take responsibility that the new
response be semantically correct.
It can't be correct behaviour that a CGI script sends a complete, valid response
("200 OK"), which is then corrupted by the server in that way.
There are IMO two options to handle such situations:
1. A server must not change the semantics of the response AT ALL.
2. A server can be seen as some sort of proxy which is allowed to change the
response in CONSISTENT ways.
It seems that the CGI draft specification implies #1, while Apache actually does
#2 in an inconsistent(!) way.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 41245] - Apache2 sends wrong status code with "Not modified" response.
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41245>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=41245
nick@webthing.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
------- Additional Comments From nick@webthing.com 2006-12-26 10:16 -------
If a CGI script emits a Status: header, then CGI takes responsibility for it.
Apache can make that decision if and only if CGI is silent on the subject.
Here's from the CGI spec:
7.2.1.3. Status
The "Status" header field is used to indicate to the server what status code
the server MUST use in the response message.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org