-
Notifications
You must be signed in to change notification settings - Fork 24.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
Media-type parser #61987
Merged
+396
−112
Merged
Media-type parser #61987
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
5e42390
Split responsibility for format parsing
pgomulka 01f001d
parse * and ndjson
pgomulka 50a88a0
make format not accepting applicaiton/
pgomulka fb03ffd
post data request should parse applicaiton/json style
pgomulka 09f281e
unused import
pgomulka 8bc024f
fix sql parsing
pgomulka 070508c
split format and accept header
pgomulka 3c7ab16
fix and todos
pgomulka 59a7f42
Merge branch 'master' into xcontent_format_parsing
pgomulka 968b1c9
media type parser
pgomulka 46f8f33
media type parser
pgomulka cbbe093
precommit
pgomulka 222caee
rename and null check
pgomulka 6bdec13
Merge branch 'master' into header_version_split
pgomulka ee97564
Merge branch 'master' into header_version_split
pgomulka 7f52e11
fix text format parsing
pgomulka 63db70c
Merge branch 'master' into header_version_split
pgomulka 57ddb40
Apply suggestions from code review
pgomulka b5f1eff
code review follow up
pgomulka 90e798d
Merge branch 'header_version_split' of github.com:pgomulka/elasticsea…
pgomulka fa49be4
javadoc and validation
pgomulka 31d92ac
Update x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/pl…
pgomulka a925fbe
Merge branch 'header_version_split' of github.com:pgomulka/elasticsea…
pgomulka 23c4e41
javadoc fix
pgomulka b1e3fb1
remove shortName
pgomulka c17a895
javadoc fix
pgomulka 7d6bd08
fix compile error
pgomulka 3c93954
fix test compile
pgomulka 77068a8
Merge branch 'master' into header_version_split
pgomulka 8fb0cd4
Merge branch 'master' into header_version_split
pgomulka 63fb6c7
remove todo and a testcase
pgomulka 4598a0a
Apply suggestions from code review
pgomulka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix and todos
- Loading branch information
commit 3c7ab16fc839d7ade510e8025ad39f106d12752f
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,7 @@ protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient cli | |
* that doesn't parse it'll throw an {@link IllegalArgumentException} | ||
* which we turn into a 400 error. | ||
*/ | ||
//TODO PG this all logic needs a review from SQL team | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove reminder. |
||
XContentType xContentType = getXContentType(accept, acceptHeader, contentTypeHeader); | ||
textFormat = xContentType == null ? TextFormat.fromMediaTypeOrFormat(accept) : null; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,7 @@ private XContentType detectContentType(String content) { | |
//There must be a __<content_type__:: prefix so the minimum length before detecting '__::' is 3 | ||
int endOfContentName = content.indexOf("__::", 3); | ||
if (endOfContentName != -1) { | ||
//TODO PG what do we expect here? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can remove this todo, answered in another comment. |
||
return XContentType.fromFormat(content.substring(2, endOfContentName)); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe open an issue for this. My guess is that there is some precedence already and it might be that format overrides the header
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.
raised #62294 to discuss this