Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Unimplemented REST methods should set a 405 status #4808

Closed
wants to merge 4 commits into from
Closed

Conversation

corentin-larose
Copy link
Contributor

Unimplemented http methods now set a 405 status

Corentin Larose added 2 commits July 11, 2013 13:44
…in AbstractRestfulController

Since no method is mandatory in REST, AbstractRestfulController shouldn't force to implement these methods (create, delete, get, getList and update) thus conducing to a concrete class with empty/unused methods.
@mwillbanks
Copy link
Contributor

Please add in unit tests to verify the behavior.

@corentin-larose
Copy link
Contributor Author

My bad, should have done that.

@ghost ghost assigned weierophinney Jul 19, 2013
@weierophinney
Copy link
Member

Great idea -- wish I'd thought of this before!

weierophinney added a commit that referenced this pull request Jul 19, 2013
weierophinney added a commit that referenced this pull request Jul 19, 2013
@imel96
Copy link
Contributor

imel96 commented Jul 30, 2013

It looks better, but stated in rfc regarding 405 status: "...The response MUST include an Allow header containing a list of valid methods for the requested resource."
It's for that reason I use 501 (not implemented) because I don't have to return anything (SHOULD) while with 405 I MUST return something, although 501 is not perfect too (it's saying method not implemented for any resources).

@corentin-larose corentin-larose deleted the #4564 branch March 14, 2014 12:39
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants