You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2018/11/07 16:29:27 UTC

[GitHub] rob05c commented on issue #2997: '501 Not Implemented' is an improper response for available API versions

rob05c commented on issue #2997: '501 Not Implemented' is an improper response for available API versions
URL: https://github.com/apache/trafficcontrol/issues/2997#issuecomment-436685890
 
 
   @ocket8888 The RFC you linked, RFC 2616, has been obsoleted by RFC 7231. Per RFC 7231: 
   
   >   The 501 (Not Implemented) status code indicates that 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.
   
   https://tools.ietf.org/html/rfc7231#section-6.6.2
   
   Yes, 501 is appropriate for methods not supported. But it also more generically "indicates that the server does not support the functionality required to fulfill the request". Nowhere in there does the RFC indicate the functionality not supported SHOULD or MUST be "HTTP functionality".
   
   >The proper response code for a path that does not exist on the server is 404 Not Found.
   
   A 404 is technically appropriate, but I do not believe a 501 to be inappropriate. A 404 does not indicate that the functionality may or may not be supported by future versions, where 501 allows us to indicate the real problem, namely that newer API version was requested. Yes, we could encode the real problem in a proprietary message in the body. but a 501 is the most likely to more readily help the user understand the real problem.
   
   https://tools.ietf.org/html/rfc7231#section-6.6
   >   The 5xx (Server Error) class of status code indicates that the server
   >   is aware that it has erred or is incapable of performing the
   >   requested method.
   
   https://tools.ietf.org/html/rfc7231#section-6.5
   >    The 4xx (Client Error) class of status code indicates that the client
   >   seems to have erred.
   
   A 4xx indicates a client problem, where a 5xx indicates a server problem. In this case, the client is correct, it's just newer than the server. The server is outdated. The real problem is that to use the new client functionality, the user needs to upgrade their Traffic Ops server. So, a 5xx, and specifically a 501, most accurately conveys the real problem to the user. 
   
   Yes, you could argue the client has "erred" by being too new. But that seems like an odd argument to me.
   
   TLDR Yes, we're using a broad interpretation of the RFC, but I don't believe it to be strictly incorrect, and it's the best way to quickly convey the problem to the user.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services