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

Http status codes #84

Merged
merged 2 commits into from
Jul 10, 2019
Merged

Http status codes #84

merged 2 commits into from
Jul 10, 2019

Conversation

fmigneault
Copy link
Contributor

When raising any OWSException, the returned response actually always indicate 200 which is confusing in case of unauthorized or bad requests cases.

This PR fixes this by making forbidden services have 401 (unauthorized), missing parameters have 400 (bad request), missing service 404 (not found), ect. The XML body is untouched.

OWSException can set status_base directly in the class definition, or pass it as input parameter when raised for custom status code for a given specific case. The value can be any of the int status code, the HTTPException type, or an HTTPException instance.

Copy link
Member

@cehbrecht cehbrecht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@cehbrecht
Copy link
Member

Test failed because PR is missing #83.

@cehbrecht cehbrecht merged commit 39ed5e6 into master Jul 10, 2019
@cehbrecht cehbrecht deleted the http-status-codes branch July 10, 2019 11:22
@cehbrecht
Copy link
Member

@fmigneault merged. Thanks :)

@cehbrecht cehbrecht added this to the 0.6.0 milestone Jul 10, 2019
@fmigneault
Copy link
Contributor Author

@cehbrecht do you mind if I tag it as 0.5.2?
It will be useful for a current project on our side.

@cehbrecht
Copy link
Member

@fmigneault sure, go ahead.

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

Successfully merging this pull request may close these issues.

2 participants