smithy-lang / smithy-rs

Code generation for the AWS SDK for Rust, as well as server and generic smithy client generation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@restJson1 and charset=utf8 in the header

x1a0 opened this issue · comments

Hi,

Probably a stupid question - I have a service defined with @restJson1. The incoming requests that have header Content-Type: application/json work fine.
However if they carry header Content-Type: application/json; charset=utf8, the server just returns:

415 Unsupported Media Type

Is there anyway to configure the header value matching somehow?
Thanks in advance.

Looks like charset should not be set for application/json. I will add a layer to remove it.

Actually, servers should accept this kind of requests. We recently identified this bug and it is being fixed in #3576.