-
Notifications
You must be signed in to change notification settings - Fork 190
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
HTTP 406 when request header includes "accept: */*" #1544
Comments
Oh nice, I just ran into this exact same issue. To give a concrete use case, I am unable to use the generated typescript clients from smithy-typescript in the browser, they fail with a 406 response because they send On whatever end this gets fixed, it seems like the smithy-typescript clients should be able to talk to the smithy-rs servers when generated against the same model. |
Just to add in one more failing case: the client I'm using sends |
I'm thinking that to fix this, we could implement a |
With the PR to tower http, it would become like this. Should we still have the check on our side, instead of asking users to add that layer manually? |
@82marbag We can't rely on users wrapping their Smithy service in the appropriate layer. It's also something that needs to be applied in codegen at the operation level. My idea is that we eventually vend it as middleware, which implements both We'd also need to map from whatever response the Take the The more I think about it the more I think we should just have a simple |
Fixed now, you can pull from |
Can we add some protocol tests? |
It seems the generated server code is overly strict about requiring
Accept: application/json
. By default, clients like curl often sendAccept: */*
, but this produces a HTTP 406 response. This doesn't seem like the right behavior.HTTP 1.1 RFC for Accept header - https://httpwg.org/specs/rfc7231.html#header.accept
Details
This occurs consistently with
aws-smithy-http-server = "0.44"
. If I use the generated code for an simple service like thisSmithy
I believe the origin of the problem is the generated code I found in
operation.rs
Fails with
Accept: */*
Passes with
Accept: application/json
The text was updated successfully, but these errors were encountered: