-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Proxy sets "Transfer-Encoding: chunked" when proxying GET request #402
Comments
I don't believe TLS is related, but rather that it's a GET request, and the way body is constructed and the given to hyper means it isn't able to detect that the body is empty. There is a fix in hyper master to just assume no body on GET if no content length is set... |
Is this a regression from 0.2, or was this the case for 0.2 too? |
It's not a regression. Just likely no test case to see it. |
The RFC says: "The presence of a message body in a request is signaled by a Content-Length or Transfer-Encoding header field." So it isn't just GET and it isn't just Content-Length. |
I realize that. It's a combination of how it's used in the proxy. By default, in hyper, a request doesn't have a body unless set. In the proxy, since it's translating from potentially an h2 stream, a body is added to the request. hyper sees the set body and assumes a transfer encoding if content length wasn't set. It's a deficiency in the current API, where it's not possible to know if a set body is actually empty until after the headers are sent. The body trait will gain a method to check for it being empty in the next breaking release. In the mean time, it ignores chunked bodies for GET, since that's probably not what you meant. |
Thanks for the explanation -- have updated the title accordingly. |
This is fixed in hyper v0.11.19. Closes #402
This is fixed in hyper v0.11.19. Closes #402 Signed-off-by: Sean McArthur <sean@seanmonstar.com>
This is fixed in hyper v0.11.19. Closes #402 Signed-off-by: Sean McArthur <sean@seanmonstar.com>
This is fixed in hyper v0.11.19. Closes #402
This is fixed in hyper v0.11.19. Closes linkerd#402
First reported by @franziskagoltz.
It looks like the conduit proxy is adding a "Transfer-Encoding: chunked" header when proxying my get request.
To test, I've been injecting the proxy into a linkerd config that forwards traffic to https://httpbin.org, available here:
proxy.txt (actually .yml but file extension not supported)
If I apply that config in minikube and curl the 'proxy-https' service, it successfully returns a 200:
Whereas if I inject that config with conduit and try curling, it fails with a 501:
The 501 response body is:
Fwiw, I've tested this with conduit master before and after #397 merged, and it appears to behave the same.
The text was updated successfully, but these errors were encountered: