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 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.

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.
Copy link
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Kova93
Copy link
Author

Kova93 commented Jul 26, 2019

Yes, the doc of CURLOPT_POST has to be updated.

@bagder
Copy link
Member

bagder commented Jul 26, 2019

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

@bagder
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
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.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants