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

Require Content-Type for /_session POST #4161

Merged
merged 2 commits into from Sep 1, 2022
Merged

Conversation

jaydoane
Copy link
Contributor

@jaydoane jaydoane commented Sep 1, 2022

Overview

Currently, when POSTing to /_session with a Content-Type header other than either application/x-www-form-urlencoded or application/json, the error response can be surprising.

This changes the response to 415 bad_content_type when it's not one of the above.

Testing recommendations

make eunit apps=couch suites=couchdb_auth_tests

Related Issues or Pull Requests

Checklist

  • Code is written and works correctly
  • Changes are covered by tests
  • Any new configurable parameters are documented in rel/overlay/etc/default.ini
  • A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation

Currently, when POSTing to `/_session` with a Content-Type header
other than either `application/x-www-form-urlencoded` or
`application/json`, the error response can be surprising.

This changes the response to 415 `bad_content_type` when it's not one
of the above.
@jaydoane jaydoane marked this pull request as ready for review September 1, 2022 21:36
Copy link
Contributor

@nickva nickva left a comment

Choose a reason for hiding this comment

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

+1

@jaydoane jaydoane merged commit 82dca90 into main Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants