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 2012/03/08 16:14:31 UTC

DO NOT REPLY [Bug 52859] New: Apache will not return a custom error page on a 400 with a malformed host header

https://issues.apache.org/bugzilla/show_bug.cgi?id=52859

             Bug #: 52859
           Summary: Apache will not return a custom error page on a 400
                    with a malformed host header
           Product: Apache httpd-2
           Version: 2.2.20
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: All
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: william@ezpcltd.com
    Classification: Unclassified


I have added the following line to a site:

ErrorDocument 400 /somepage.php

When a request comes in with a 400 error code (can test by going to
http:\\site.com\test%test), it redirects fine. However, if there is a malformed
host header, it will not go to the custom page - just the default 400 page.

This is not that easy to test. In Windows you can use Wfetch and add a bad
header... for example "Host: blablablabla.net", not sure how to test elsewhere.

If I change from the above ErrorDocument to a string - 

ErrorDocument 400 "test text"

Apache will print the above text in any situation - the above URL or (and most
importantly) a bad host header.

I have asked for help from many places and I just can't get an answer, and due
to the fact that the string works on either, I can only conclude that this is a
bug.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 52859] Apache will not return a custom error page on a 400 with a malformed host header

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52859

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #1 from Eric Covener <co...@gmail.com> 2012-03-08 15:18:23 UTC ---
Marking as wontfix, when a request is malformed, the server isn't willing to do
further processing to serve a custom errordocument out of the filesystem (your
error page should have told you a recursive 400 was encountered)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 52859] Apache will not return a custom error page on a 400 with a malformed host header

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52859

--- Comment #3 from Eric Covener <co...@gmail.com> 2012-03-08 16:00:41 UTC ---
(In reply to comment #2)
> Thank you for the quick reply...
> 
> ... Is there anything that can be done or to override this behavior?
> 
> I can understand that being the default behavior, but, the fact that you allow
> strings shows that it does something after getting the 400 and not just end it
> there - so, why not forward on to a page?

Because a literal string doesn't require further server processing that depends
on the malformed request to map a request to a file.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 52859] Apache will not return a custom error page on a 400 with a malformed host header

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52859

--- Comment #2 from William Hilsum <wi...@ezpcltd.com> 2012-03-08 15:27:47 UTC ---
Thank you for the quick reply...

... Is there anything that can be done or to override this behavior?

I can understand that being the default behavior, but, the fact that you allow
strings shows that it does something after getting the 400 and not just end it
there - so, why not forward on to a page?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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