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

Fix _bulk_docs crash when provided revision can't be parsed #1897

Merged
merged 2 commits into from Feb 5, 2019

Conversation

Projects
None yet
2 participants
@eiri
Copy link
Member

eiri commented Feb 1, 2019

Overview

If a doc's revision provided with _bulk_docs matches the expected length it assumed to be a parsable hexadecimal. When this is not the case couch_doc:couch_doc:from_json_obj_validate/2 function crashes with badarg.

The fix catches the exception and re-throws it as a doc_validation exception to raise "400 Bad Request" error.

Testing recommendations

make eunit apps=couch suites=couch_doc_json_tests or the manual stps from case #1895

Related Issues or Pull Requests

Closes #1895

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;

@eiri eiri force-pushed the fix-bulk_docs-invalid-rev-crash branch from 57c0f04 to 4568979 Feb 5, 2019

@eiri eiri merged commit 9517b26 into master Feb 5, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@eiri eiri deleted the fix-bulk_docs-invalid-rev-crash branch Feb 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.