-
Notifications
You must be signed in to change notification settings - Fork 201
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
Server sometimes responds with HTTP 415 for GET requests which include Content-Type header #1845
Comments
Does this happen only when your model input is empty? It's forbidden here. This could be a question for the smithy team |
Yes. That's an odd quirk. I noticed it happening on a "ping" API that I implemented with an empty operation
But the issue goes away if I add a dummy input structure.
|
We're complying with the Smithy spec here, it's not a smithy-rs specific behavior. You could ask to Smithy: https://github.com/awslabs/smithy |
Note that if your operation has an empty input struct, this behavior does not apply. It does apply only when there is no input in the model |
Yes, it would be good to clarify with Smithy because the spec you linked to here only shows examples of POST requests. In my case, I'm dealing with GET requests. It seems like inconsistent behavior from a user perspective. The exact same |
After upgrading from 0.48 to 0.49, I started getting HTTP 415 for GET calls that include the Content-Type header. My interpretation of the RFCs on this header https://httpwg.org/specs/rfc9110.html#representation.metadata is that this behavior falls into an unspecified area.
It makes sense that -- strictly speaking -- this header should not be attached to requests without a message body.
But on the other hand, a common approach is to make servers lenient and ignore headers that don't matter. So, would it be better if the SmithyRs server simply ignored the "Content-Type" header for GET requests instead?
The text was updated successfully, but these errors were encountered: