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 2009/01/28 00:16:48 UTC

DO NOT REPLY [Bug 46615] New: Apache returns 501 on unknown method; can't guarantee this is correct

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

           Summary: Apache returns 501 on unknown method; can't guarantee
                    this is correct
           Product: Apache httpd-2
           Version: 2.2.9
          Platform: Macintosh
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: geoffers+asfbug@gmail.com


When there is any CGI scripts, or modules loaded, Apache's current behaviour of
returning 501 on an unknown method goes against the definition of the status
code in RFC2616. This is because the server might support the method on some
resource which is accessed by the CGI/module.

To quote the 501 status code definition:

"The server does not support the functionality required to fulfill the request.
This is the appropriate response when the server does not recognize the request
method and is not capable of supporting it for any resource."

While none of this is normative, the latter sentence makes this behaviour
incorrect for Apache. I might have a CGI/module accessed resource which can
support the method, even if Apache itself, serving static files, cannot.

I would suggest using "405 Method Not Allowed", but I realize that this
requires sending an Allow header, which may not be possible.

To re-create: access any resource served by Apache directly (and not via a
module or CGI script) using the method "foo" and view the status code.


-- 
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 46615] Apache returns 501 on unknown method; can't guarantee this is correct

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


Nick Kew <ni...@webthing.com> changed:

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


--- Comment #2 from Nick Kew <ni...@webthing.com> 2009-08-29 22:33:50 PDT ---
This is a configuration issue.  It's the default handler that returns 501, and
it only reaches the default handler if no module or script has handled the
request - which means that nothing handles the method.  501 is correct at this
point.

You could of course work around it, either with an ErrorDocument or in your
module/script.

-- 
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 46615] Apache returns 501 on unknown method; can't guarantee this is correct

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





--- Comment #1 from Geoffrey Sneddon <ge...@gmail.com>  2009-01-27 15:19:03 PST ---
I just noticed it already sends an Allow header, so it is certainly possible to
return 405.


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