-
Notifications
You must be signed in to change notification settings - Fork 105
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
Uploading file to S3 (proxied) http: ContentLength=... with Body length 0
#225
Comments
cc @rapphil it would be great, if we get some help here. |
@rapphil We tried to understand the problem. What We Did
Issue: The mismatch between Content-Length and the actual body length remains unresolved. |
cc @alvinlin123 |
Fixes awslabs#225 The problem is the the `sign` method in ProxyClient reads the `req.Body` and that results in a closed reader. When the request is actually send to the transport later, the body cannot be read and results in a body length of 0 which does not match the passed req.ContentLength. We tried to write tests for this, but the tests are not fully matching the real world because: * they use io.NopCloser * they use a HTTP mock client that doesn't actually read the body to send to the proxy (makes sense, its a mock, but it's different than the actual implementation)
We fixed the problem in #229 |
Our goal is to use this library in a container to proxy file upload requests to S3. When doing so, we run into an error
http: ContentLength=... with Body length 0
. Any tips on how to resolve this?Steps to reproduce
Start image
Send image
Responds with
View debug logs
The text was updated successfully, but these errors were encountered: