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

Throw exception if content type could not be determined in Update API #15904

Merged
merged 1 commit into from Jan 12, 2016

Conversation

Projects
None yet
3 participants
@abeyad
Copy link
Contributor

commented Jan 11, 2016

If the content type could not be determined, the UpdateRequest would still try to parse the content instead
of throwing the standard ElasticsearchParseException. This manifests when
passing illegal JSON in the request body that does not begin with a '{'.
By trying to parse the content from an unknown request body content type,
the UpdateRequest was throwing a null pointer exception. This has been
fixed to throw an ElasticsearchParseException, to be consistent with the
behavior of all other requests in the face of undecipherable request
content types.

Closes #15822

Ali Beyad
Fixes an issue where, if the content type of the request body could n…
…ot be

determined, the UpdateRequest would still try to parse the content instead
of throwing the standard ElasticsearchParseException.  This manifests when
passing illegal JSON in the request body that does not begin with a '{'.
By trying to parse the content from an unknown request body content type,
the UpdateRequest was throwing a null pointer exception.  This has been
fixed to throw an ElasticsearchParseException, to be consistent with the
behavior of all other requests in the face of undecipherable request
content types.

Closes #15822
@abeyad

This comment has been minimized.

Copy link
Contributor Author

commented Jan 11, 2016

@jpountz not sure if you have the time, but this PR needs a code review! Also, should it be backported to v2.2.0 as well?

@clintongormley clintongormley changed the title Fixes an issue where, if the content type of the request body could n… Throw exception if content type could not be determined in Update API Jan 12, 2016

@jpountz

This comment has been minimized.

Copy link
Contributor

commented Jan 12, 2016

LGTM!

Also, should it be backported to v2.2.0 as well?

+1 to push it to 2.2 as well

@abeyad abeyad added the v2.2.0 label Jan 12, 2016

abeyad pushed a commit that referenced this pull request Jan 12, 2016

Ali Beyad
Merge pull request #15904 from abeyad/fix_15822
Throw exception if content type could not be determined in Update API

@abeyad abeyad merged commit 7846e5a into elastic:master Jan 12, 2016

1 check passed

CLA Commit author is a member of Elasticsearch
Details
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.