[openstack-dev] HTTP response code for not implemented features

Sean Dague sdague at linux.vnet.ibm.com
Thu Dec 6 21:09:23 UTC 2012


+1

Sure, I can get behind that, as it's a pretty pragmatic approach. 
Realistically we're already using 501 in the code in a few places today 
anyway, so my concern about it possibly breaking some one can't be true.

It's probably worth noting that we should reset the template in 
webob.exc.HTTPNotImplemented before throwing it though, because it could 
cause confusion if it ever manages to bubbles up. I've seen the html 
templates bubble up on some manual fuzzing I've been doing recently.

code included for reference
....
class HTTPNotImplemented(HTTPServerError):
     """
     subclass of :class:`~HTTPServerError`

     This indicates that the server does not support the functionality
     required to fulfill the request.

     code: 501, title: Not Implemented
     """
     code = 501
     title = 'Not Implemented'
     template = Template('''
The request method ${REQUEST_METHOD} is not implemented for this server. 
<br /><br />
${detail}''')

On 12/06/2012 02:20 PM, Gabriel Hurley wrote:
> My reading of 501 has always been as Mark describes. But even if you want to argue semantics of the definition the point stands the in this case 501 is a more meaningful error to receive than a generic 400. There are myriad other reasons a 400 could be returned and then a consumer of the API has to deal with parsing messages and other nonsense. A 501 has only one reason it would be returned by that API and is therefore much more useful to consumers. I would hope that's reason enough to make the decision.
>
>      - Gabriel
>
>> -----Original Message-----
>> From: Jay Pipes [mailto:jaypipes at gmail.com]
>> Sent: Thursday, December 06, 2012 8:06 AM
>> To: openstack-dev at lists.openstack.org
>> Subject: Re: [openstack-dev] HTTP response code for not implemented
>> features
>>
>> On 12/06/2012 06:58 AM, Mark McLoughlin wrote:
>>>      The first sentence makes it seem like 501 is a good fit here. I
>>>      take the second sentence to be an example of one of cases where 501
>>>      is appropriate, rather than the only case.
>>>
>>>
>>> I think I'm still leaning towards 501. Any thoughts?
>>
>> +1
>>
>> -jay
>>
>> _______________________________________________
>> OpenStack-dev mailing list
>> OpenStack-dev at lists.openstack.org
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>


-- 
Sean Dague
IBM Linux Technology Center
email: sdague at linux.vnet.ibm.com
alt-email: sldague at us.ibm.com




More information about the OpenStack-dev mailing list