-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Decoding response from gRPC REST proxy results in "Invalid chunk end CR" error #2171
Decoding response from gRPC REST proxy results in "Invalid chunk end CR" error #2171
Comments
That is actually valid chunked encoding, using chunked trailers. hyper just hasn't supported them, because practically nothing has ever used them and they are annoying to deal with. gRPC of HTTP/1.1 decided "oh hey, we can do trailers with this obscure detail of chunked encoding". Grumble. |
Checking RFC7230, a server shouldn't send chunked trailers if the client didn't include a Perhaps hyper should strip that header as long as it doesn't have h1 trailers support. |
That is really interesting, I didn't know that :)
No my request did not include such header. I guess that results in two follow-up actions. |
I have the same problem. Original bug report is on linkerd2 repo |
Agree with you. |
Actually hyper strips that trailer, but after this i am getting |
hyper doesn't have any handling of the |
Helllo @seanmonstar! I think we are misunderstood each other. |
Just stumbled on this ourselves. We're proxying a response from a nginx instance that uses
76655 is the full size of the transfer, but since it produces an unexpected EOF, that curl errors. I know this way of doing things is not very common, but some of our customers might eventually do it and stumble on this bug. It wasn't very easy to troubleshoot. My only clue was "error reading a body from connection: Invalid chunk end CR" which led me here. |
Previously, hyper returned an "Invalid chunk end CR" error on chunked responses with trailers, as described in RFC 7230 Section 4.1.2. This commit adds code to ignore the trailers. Closes #2171
I suppose this specific issue is fixed, but now I wonder if it would be possible to accept trailers? Our use case is: upstream clients can send back trailer headers containing metrics, including timing which may only be available after initial headers have been sent. |
Previously, hyper returned an "Invalid chunk end CR" error on chunked responses with trailers, as described in RFC 7230 Section 4.1.2. This commit adds code to ignore the trailers. Closes hyperium#2171
Previously, hyper returned an "Invalid chunk end CR" error on chunked responses with trailers, as described in RFC 7230 Section 4.1.2. This commit adds code to ignore the trailers. Closes #2171 Co-authored-by: Alex Rebert <alex@forallsecure.com>
Previously, hyper returned an "Invalid chunk end CR" error on chunked responses with trailers, as described in RFC 7230 Section 4.1.2. This commit adds code to ignore the trailers. Closes hyperium#2171
I am integrating with a go application that uses the gRPC REST proxy to provide an HTTP API.
My HTTP client is
reqwest
which useshyper:0.13.3
at this stage.The go application sends the following response:
I've added a test to the hyper test suite that reproduces the issue: thomaseizinger@a608b28
I don't know whether this is a valid HTTP response. Reading through the HTTP spec, it seems like this grpc trailer stuff is violating the
Transfer-Encoding: chunked
spec because the chunked is advertised as 0 bytes which from what I understand means the response is over, yet there are more bytes following.Interestingly,
curl
is able to handle the response just fine but that could just be an artifact of curl being very robust to these kind of mistakes.Even if this is an invalid response, it would be nice if
hyper
could be robust here and just ignore everything that is coming after the0
chunk size indicator.The text was updated successfully, but these errors were encountered: