You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/06/08 00:01:40 UTC

[GitHub] [trafficserver] masaori335 commented on pull request #7886: Enforce case for well known methods

masaori335 commented on pull request #7886:
URL: https://github.com/apache/trafficserver/pull/7886#issuecomment-856340023


   > [RFC 7230 3.1.1.  Request Line](https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.1)
   > The method token indicates the request method to be performed on the
   > target resource.  The request method is case-sensitive.
   >
   > method         = token
   >
   > The request methods defined by this specification can be found in
   > Section 4 of [RFC7231], along with information regarding the HTTP
   > method registry and considerations for defining new methods.
   > ...
   > Recipients of an invalid request-line SHOULD respond with either a
   > 400 (Bad Request) error or a 301 (Moved Permanently) redirect with
   > the request-target properly encoded.
   
   If we think the lower-case or mixed-case method is "invalid request-line", we should send 400 or 301.
   
   > [RFC 7231 4.  Request Methods](https://datatracker.ietf.org/doc/html/rfc7231#section-4.1)
   > 4.1.  Overview
   > ...
   > By convention, standardized methods are defined in all-uppercase
      US-ASCII letters.
      ...
   > The set of methods allowed by a target resource can be listed in an
      Allow header field (Section 7.4.1).  However, the set of allowed
      methods can change dynamically. When a request method is received
      that is unrecognized or not implemented by an origin server, the
      origin server SHOULD respond with the 501 (Not Implemented) status
      code.  When a request method is received that is known by an origin
      server but not allowed for the target resource, the origin server
      SHOULD respond with the 405 (Method Not Allowed) status code.
   
   If we think it's "unrecognized" or "not implemented" method, we SHOULD send 501.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org