Closed ValentinColin closed 3 months ago
Axum use the Mime crate to parse the the MediaType but it doesn't seem general enough.
Sorry, but this is just Amazon doing weird things. I don't think that Content-Type
value is something we should support in the Json
extractor as long as it checks the content-type at all.
I would recommend that you look into why Amazon is sending this and if it can't be changed but is still regular JSON, either create a middleware that rewrites the header to application/json
if it sees this special Amazon-specific value, or copy-paste the Json
extractor into your codebase and adjust it to work as you need it.
Bug Report
Version
0.7.5
Platform
Linux x86_64
Crates
axum
Description
When I use the ContentType header
application/x-amz-json-1.1
with a json body, I get the following error from JsonRejectionAxum use the Mime crate to parse the the MediaType but it doesn't seem general enough.