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

libcurl: use chunked Transfer-Encoding for HTTP_POST if size unknown #4138

Closed
wants to merge 1 commit into from

Conversation

@Kova93
Copy link

Kova93 commented Jul 22, 2019

If using the read callback for HTTP_POST, and POSTFIELDSIZE is not set,
automatically add a Transfer-Encoding: chunked header, same as it is
already done for HTTP_PUT, HTTP_POST_FORM and HTTP_POST_MIME.
Update test 1514 according to the new behaviour.

@Kova93 Kova93 force-pushed the Kova93:master branch from 0ff3e89 to 59c62e3 Jul 23, 2019
If using the read callback for HTTP_POST, and POSTFIELDSIZE is not set,
automatically add a Transfer-Encoding: chunked header, same as it is
already done for HTTP_PUT, HTTP_POST_FORM and HTTP_POST_MIME.
Update test 1514 according to the new behaviour.
@Kova93 Kova93 force-pushed the Kova93:master branch from 59c62e3 to 8672595 Jul 24, 2019
@bagder
bagder approved these changes Jul 25, 2019
Copy link
Member

bagder left a comment

I think it makes sense to unify the behavior like this. Is there any docs that need updating after this fix?

@Kova93

This comment has been minimized.

Copy link
Author

Kova93 commented Jul 26, 2019

Yes, the doc of CURLOPT_POST has to be updated.

@bagder

This comment has been minimized.

Copy link
Member

bagder commented Jul 26, 2019

will you make that change as well as part of this PR?

@bagder

This comment has been minimized.

Copy link
Member

bagder commented Jul 29, 2019

Thanks! I updated the docs slightly before I pushed.

@bagder bagder closed this in 802aa5a Jul 29, 2019
@Kova93

This comment has been minimized.

Copy link
Author

Kova93 commented Jul 29, 2019

Thanks, and sorry for not responding, I was away for the weekend.

mkauf added a commit to mkauf/mod_md that referenced this pull request Oct 25, 2019
libcurl 7.66.0 automatically adds a "Transfer-Encoding: chunked" header
if the content length is not known to libcurl, because of this change:
curl/curl#4138

libcurl does not parse custom "Content-Length" headers, it needs the
content length using the options CURLOPT_POSTFIELDSIZE(_LARGE) and
CURLOPT_INFILESIZE(_LARGE).

The "Boulder" server rejects requests with both headers, but the host
acme-v02.api.letsencrypt.org accepts such requests, probably because
there's a reverse proxy.
@lock lock bot locked as resolved and limited conversation to collaborators Oct 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.