Skip to content
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

logging of http request may empty input data #99

Closed
dataclouder opened this issue Sep 27, 2018 · 0 comments
Closed

logging of http request may empty input data #99

dataclouder opened this issue Sep 27, 2018 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@dataclouder
Copy link
Contributor

The logging of HTTP requests in api.go may empty the data when the body is not a *bytes.Buffer.

Most of the requests in the API are created using a *bytes.Buffer, but some aren't. When the body is some other kind of io.Reader, copying the contents will empty the buffer, and the request will fail.

To fix it, we will check whether the body type is *bytes.Buffer and make the copy only in that case.

@dataclouder dataclouder added the bug Something isn't working label Sep 27, 2018
@dataclouder dataclouder self-assigned this Sep 27, 2018
dataclouder added a commit that referenced this issue Sep 27, 2018
Fixes Issue #99 error in logging of HTTP requests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant