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

Set content-length when setting body #156

Merged
merged 1 commit into from
Jun 18, 2018
Merged

Conversation

erwinvaneyk
Copy link
Member

The Content-Length header in Golang http requests is only set when using NewRequest (instead of being set when the actual request is send). This means that when setting the Body field after the initial construction of the request, the content-length will remain unset unless explicitly set by the user.

To fix this issue, this PR explicitly sets the contentLength when setting the body.

As a flyby this PR also changes the default method to be used for fission requests to post, as this used to be (and still should be) the default.

cc @soamvasani

@erwinvaneyk erwinvaneyk merged commit 0cfcc0a into master Jun 18, 2018
@erwinvaneyk erwinvaneyk deleted the set-content-length branch June 18, 2018 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant