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

Make media type parsing strict #63080

Open
pgomulka opened this issue Sep 30, 2020 · 1 comment
Open

Make media type parsing strict #63080

pgomulka opened this issue Sep 30, 2020 · 1 comment
Labels
:Core/Infra/REST API REST infrastructure and utilities >enhancement Team:Core/Infra Meta label for core/infra team

Comments

@pgomulka
Copy link
Contributor

pgomulka commented Sep 30, 2020

at the moment, we do not throw an explicit exception when an unsupported media type is used either in code or by users.
We should validate this when parsing and throw an explicit error to the user.
This will require changes across the codebase were we rely on parsing returning null and the logic is retrying parsing in a different way (a value from content-type or format parameter)

Also important to not allow java default accept header "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" which is sets by sun.net.www.protocol.http.HttpURLConnection

Make / parsing strict to return JSON

Unknown parameters for a known media type should also throw an exception
Validation of charset parameter should be enforced. Deprecation warnings for charset should be emitted in 7.x

comments #61427 (comment)

relates #61427

@pgomulka pgomulka added >enhancement :Core/Infra/REST API REST infrastructure and utilities needs:triage Requires assignment of a team area label labels Sep 30, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/REST API)

@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Sep 30, 2020
@danielmitterdorfer danielmitterdorfer removed the needs:triage Requires assignment of a team area label label Oct 13, 2020
@rjernst rjernst added the needs:triage Requires assignment of a team area label label Dec 3, 2020
@jaymode jaymode removed the needs:triage Requires assignment of a team area label label Dec 9, 2020
fixmebot bot referenced this issue in VectorXz/elasticsearch Apr 22, 2021
fixmebot bot referenced this issue in VectorXz/elasticsearch May 28, 2021
fixmebot bot referenced this issue in VectorXz/elasticsearch Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/REST API REST infrastructure and utilities >enhancement Team:Core/Infra Meta label for core/infra team
Projects
None yet
Development

No branches or pull requests

5 participants