httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 48357] Custom ErrorDocument 400 not working when Host header is missing
Date Wed, 01 Aug 2012 11:42:34 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=48357

--- Comment #5 from Petr Sumbera <petr.sumbera@oracle.com> ---
Created attachment 29147
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29147&action=edit
possible patch

Patch attached.

Example:

Apache configuration:
=====================

Add following into global section of Apache configuration file:

ErrorDocument 400 /400.html

Create 400.html file:

echo "<html><body><h1>My error 400.....</h1></body></html>"
>
/var/apache2/2.2/htdocs/400.html

Behavior without patch:
=======================

root@S11:~# telnet localhost 80
Trying ::1...
Connected to S11.1_15.
Escape character is '^]'.
GET . HTTP/1.1

HTTP/1.1 400 Bad Request
Date: Wed, 01 Aug 2012 11:21:38 GMT
Server: Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0j DAV/2 PHP/5.2.17
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
</body></html>

Behavior with applied patch:
============================

root@S11:~# telnet localhost 80
Trying ::1...
Connected to S11.1_15.
Escape character is '^]'.
GET . HTTP/1.1

HTTP/1.1 400 Bad Request
Date: Wed, 01 Aug 2012 11:24:34 GMT
Server: Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0j DAV/2 PHP/5.2.17
Last-Modified: Wed, 01 Aug 2012 11:20:45 GMT
ETag: "52f1-35-4c6327c6f4b5b"
Accept-Ranges: bytes
Content-Length: 53
Connection: close
Content-Type: text/html

<html><body><h1>My error 400.....</h1></body></html>

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message