wsme returns 500 when it should return 415
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
WSME |
Fix Released
|
Undecided
|
Chris Dent |
Bug Description
A web service should never intentionally set the response status to 500 unless it has experienced an exception that it cannot categorize into some more reasonable status code (from somewhere in the 4xx range).
WSME will give a 500 when it fails to find a satisfactory protocol handler. This can be triggered on GET or POST/PUT by sending an accept or content-type header that doesn't fit with expectations. So, for example the 500 can be triggered on the first easy app here <https:/
Similarly if the simple app is extended to allow POST/PUT:
def moo(self, cow):
print cow
return cow
this will work fine when given a content-type header of 'application/json' but 500 when given 'text/plain'. A 415 makes more sense.
I can probably submit a patch to fix this, but I'd like to get some input on if it is in alignment with goals.
Changed in wsme: | |
assignee: | nobody → Chris Dent (chdent) |
Changed in wsme: | |
milestone: | none → 0.8.0 |
status: | Fix Committed → Fix Released |
That seems like a reasonable interpretation of the error codes.