THttpService.validateRequestAndDetermineSerializationFormat on MediaType.parse(accept) failure behavior
See original GitHub issueThe following code will end with HTTP 406
for accept header such as text/plan, */*; q=0.5
.
I have two concerns.
MediaType.parse
maybe not capable foraccept
header parsing according to https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html- When
MediaType.parse
ends with exception, how about usingserializationFormat
as the fallback output serialization format?
Issue Analytics
- State:
- Created 7 years ago
- Comments:12
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
While thinking about HTTP encoding, I remembered this code that I copied as is from Netty
https://github.com/line/armeria/blob/master/core/src/main/java/com/linecorp/armeria/server/http/encoding/HttpEncoders.java#L60
If we have a generic Accept header parsing mechanism, we should probably replace it too 😃
We currently rely on
MediaType.parse()
on this, so it can’t be used foraccept-encoding
oraccept-language
, but I’d love to see this happen someday…