Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-6258

Web server should return 501 for METHOD requests which are completely unknown to it

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 7.1.0.DR8, 7.1.0.DR17
    • 7.1.0.DR5
    • Undertow
    • None
    • Hide

      Do simple HTTP request looking e.g. like this:

      BLABLABLA / HTTP/1.1
      Host: localhost
      
      Show
      Do simple HTTP request looking e.g. like this: BLABLABLA / HTTP/1.1 Host: localhost

      According to HTTP/1.1 specification, the server should return 501 in case of the method being completely unknown to the origin server. The Undertow returns in such case 405, which is incorrect.

      5.1.1 Method

      The Method token indicates the method to be performed on the
      resource identified by the Request-URI. The method is case-sensitive.

      Method = "OPTIONS" ; Section 9.2

      "GET" ; Section 9.3
      "HEAD" ; Section 9.4
      "POST" ; Section 9.5
      "PUT" ; Section 9.6
      "DELETE" ; Section 9.7
      "TRACE" ; Section 9.8
      "CONNECT" ; Section 9.9
      extension-method
      extension-method = token

      The list of methods allowed by a resource can be specified in an
      Allow header field (section 14.7). The return code of the response
      always notifies the client whether a method is currently allowed on a
      resource, since the set of allowed methods can change dynamically. An
      origin server SHOULD return the status code 405 (Method Not Allowed)
      if the method is known by the origin server but not allowed for the
      requested resource, and 501 (Not Implemented) if the method is
      unrecognized or not implemented by the origin server. The methods GET
      and HEAD MUST be supported by all general-purpose servers. All other
      methods are OPTIONAL; however, if the above methods are implemented,
      they MUST be implemented with the same semantics as those specified
      in section 9.

            thofman Tomas Hofman
            rhatlapa@redhat.com Radim Hatlapatka (Inactive)
            Jan Stourac Jan Stourac
            Jan Stourac Jan Stourac
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 day, 4 hours
                1d 4h
                Remaining:
                Time Spent - 6 hours Remaining Estimate - 6 hours
                6h
                Logged:
                Time Spent - 6 hours Remaining Estimate - 6 hours
                6h