Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported HTTP methods should return 405 and the methods allowed #398

Open
vgkholla opened this issue Jul 13, 2016 · 2 comments
Open

Unsupported HTTP methods should return 405 and the methods allowed #398

vgkholla opened this issue Jul 13, 2016 · 2 comments
Labels

Comments

@vgkholla
Copy link
Contributor

Currently RestServiceErrorCode.UnsupportedHttpMethod maps to a 400 status code. Instead it should map to 405 and should return the methods allowed (POST, GET, DELETE and HEAD).

@vgkholla
Copy link
Contributor Author

This does present a problem because a BlobStorageService might not support all of POST, GET, DELETE and HEAD (AdminBlobStorageService does not support POST) but they can handle the 405 independently. The user experience might be inconsistent in this case but this stop gap solution can work until we find a more elegant solution.

@ghost
Copy link

ghost commented Jun 10, 2017

Well the idea should be splitting the BlobStorageService interface, for the sake of Interface segregation principle. What do you think having a different interface for each use case. It would be

class AdminBlobStorageService implements BlobStorageService, HttpGetAwareRequest, HttpDeleteAwareRequest, HttpHeadAwareRequest  { ... }

Or is it too bloated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant