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/30 00:26:45 UTC

DO NOT REPLY [Bug 22951] - ProxyErrorOverride On sends wrong Content-length header after a 302 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=22951>.
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=22951





------- Additional Comments From sebastiaan@kantoor.nederhost.nl  2006-12-29 15:26 -------
Unfortunately this bug is still present in 2.0.59. When using ProxyErrorOverride On on the front-end, 
and redirecting from the backend, the front-end server sends:

- A 302 Moved with a content, but with the content-length header set to 0. This is clearly broken.
- A 200 OK response from the backend, that was the result of the redirect.

E.g., if I try to fetch /blah, which results in the backend redirecting me to /meuk. I then see the 
following in Firefox:

167
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Moved</title>
</head><body>
<h1>Moved</h1>
<p>The document has moved <a href="http://mydomain.invalid/meuk">here</a>.</p>
<hr>
<address>Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7j PHP/5.1.6 Server at mydomain.invalid 
Port 443</address>
</body></html>

0

HTTP/1.1 200 OK
Date: Fri, 29 Dec 2006 23:14:16 GMT
Server: Apache/2.0.59 (Unix) mod_perl/2.0.3 Perl/v5.8.8
Content-Type: text/html; charset=ISO-8859-1
Transfer-Encoding: chunked

478
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/
loose.dtd">
<html>
  <head>
etc.

The 200 OK request header being shown in Firefox is obviously the result of using keepalive. The 
response in which content is provided for the request but content-length is 0 is wrong, regardless of 
which status code is being used. The response itself is perfectly fine, but since the content-length is set 
to 0 this confuses Firefox; it will follow up on the redirect and then read the next request, which 
includes the content of the 302 that was not yet read. The obvious fix would be to include a content-
length header that is, well, actually specifying the length of the content that is sent to the client.

IMHO (but I do not know very much of Apache's internals) this has little to do with deciding which 
status codes are an error or not, or even the use of cookie or other headers. The content-length is 
simply not set to a valid value for this specific request in these specific conditions only.

-- 
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