httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Kline <bkl...@rksystems.com>
Subject [users@httpd] Apache sending back incorrect Content-length and Content-type values for ErrorDocument
Date Sun, 25 Feb 2007 06:11:05 GMT
Before filing a bug report, I want to check with the list to see if I'm
missing something or if this is a known bug and I just haven't found it
in the database.

I'm upgrading my server and Apache will be jumping from 2.0.46 to 2.2.3.
 I noticed when testing things on the new box that Apache's behavior
when an error occurs has changed.  On the older server, when an error
occurs, the ErrorDocument 500 directive is consulted, and the page
specified by that directive is sent back to the client with proper HTTP
headers.  For example:

$ telnet www.rksystems.com 80
Trying 66.92.147.60...
Connected to www.rksystems.com.
Escape character is '^]'.
GET /cgi-bin/barf.py HTTP/1.1
Host: www.rksystems.com:80

HTTP/1.1 500 Internal Server Error
Date: Sun, 25 Feb 2007 03:30:02 GMT
Server: Apache/2.0.46 (Red Hat)
Content-Length: 668
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error ...</p>
...
</body></html>
Connection closed by foreign host.

With the new version of Apache, however, the content length is reported
as 0 (which makes the browser think the document is empty) and the
content type is given as text/x-python, causing the browser to open a
Save dialog box instead of displaying the error 500 document:

$ telnet debian.rksystems.com 80
Trying 66.92.147.178...
Connected to debian.rksystems.com.
Escape character is '^]'.
GET /cgi-bin/barf.py HTTP/1.1
Host: debian.rksystems.com:80

HTTP/1.1 500 Internal Server Error
Date: Sun, 25 Feb 2007 03:16:46 GMT
Server: Apache/2.2.3 (Debian)
Content-Length: 0
Connection: close
Content-Type: text/x-python

<html>
 <head>
  <title>Script Failure</title>
 </head>

 <body>
  Boo-boo!
 </body>
</html>
Connection closed by foreign host.

Is this a known bug?  Is there some configuration directive I haven't
found for convincing Apache to send back the right values (as it used to)?

Many thanks!

-- 
Bob Kline
http://www.rksystems.com
mailto:bkline@rksystems.com

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