-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Refactor] XContentType to parse Accept or Content-Type headers #3077
[Refactor] XContentType to parse Accept or Content-Type headers #3077
Conversation
✅ Gradle Check success eb53c9c37fcf7a67ae676533ec46fa5dd56ad6fc |
❌ Gradle Check failure c8a57a2ef6bc1cdb8715fc833680bb666a1a1dc6 |
#1793 repeat
|
start gradle check |
✅ Gradle Check success c8a57a2ef6bc1cdb8715fc833680bb666a1a1dc6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine.
I don't love this parser implementation. IMO it should be a parser that implements rfc7231 to the letter, hopefully coming from a library that has some reliable history/tests.
libs/x-content/src/main/java/org/opensearch/common/xcontent/MediaTypeParser.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/rest/action/cat/RestTable.java
Outdated
Show resolved
Hide resolved
libs/x-content/src/main/java/org/opensearch/common/xcontent/XContentType.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/opensearch/common/xcontent/XContentTypeTests.java
Outdated
Show resolved
Hide resolved
Refactors XContentType.fromMediaTypeOrFormat to fromMediaType so Accept headers and Content-Type headers can be parsed separately. This helps in reusing the same parse logic in for REST Versioning API support. Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
c8a57a2
to
fc8cb12
Compare
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Refactors XContentType.fromMediaTypeOrFormat to fromMediaType so Accept headers and Content-Type headers can be parsed separately. This helps in reusing the same parse logic in for REST Versioning API support. Signed-off-by: Nicholas Walter Knize <nknize@apache.org> (cherry picked from commit d86c88f)
Refactors XContentType.fromMediaTypeOrFormat to fromMediaType so Accept headers and Content-Type headers can be parsed separately. This helps in reusing the same parse logic in for REST Versioning API support. Signed-off-by: Nicholas Walter Knize <nknize@apache.org> (cherry picked from commit d86c88f)
… (#3103) Refactors XContentType.fromMediaTypeOrFormat to fromMediaType so Accept headers and Content-Type headers can be parsed separately. This helps in reusing the same parse logic in for REST Versioning API support. Signed-off-by: Nicholas Walter Knize <nknize@apache.org> (cherry picked from commit d86c88f) Co-authored-by: Nick Knize <nknize@apache.org>
See opensearch-project/OpenSearch#3077. Signed-off-by: dblock <dblock@amazon.com>
* Upgraded to opensearch-rest-client 2.1.0. Signed-off-by: dblock <dblock@amazon.com> * Renamed to fromMediaType. See opensearch-project/OpenSearch#3077. Signed-off-by: dblock <dblock@amazon.com>
Refactors XContentType.fromMediaTypeOrFormat to fromMediaType so Accept headers
and Content-Type headers can be parsed separately. This helps in reusing the
same parse logic in for REST Versioning API support.
relates #3035