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

docs: update CURLOPT_UPLOAD.3 #11300

Closed
wants to merge 1 commit into from

Conversation

oleg-jukovec
Copy link
Contributor

The behavior of CURLOPT_UPLOAD differs from what is described in the documentation. The option automatically adds the
'Transfer-Encoding: chunked' header. It also ignores 'Content-Length' header at CURLOPT_HTTPHEADER.

The patch makes the documentation clearer.

The behavior of CURLOPT_UPLOAD differs from what is described in the
documentation. The option automatically adds the
'Transfer-Encoding: chunked' header. It also ignores 'Content-Length'
header at CURLOPT_HTTPHEADER.

The patch makes the documentation clearer.
@bagder
Copy link
Member

bagder commented Jun 11, 2023

It also ignores 'Content-Length' header at CURLOPT_HTTPHEADER

It always ignores that, in the sense that it doesn't read it nor parses it but just passes it along.

@bagder
Copy link
Member

bagder commented Jun 12, 2023

Thanks!

bagder added a commit that referenced this pull request Jun 12, 2023
oleg-jukovec added a commit to oleg-jukovec/tarantool that referenced this pull request Jun 12, 2023
The description of CURLOPT_UPLOAD [1] is confusing:

    If you use PUT to an HTTP 1.1 server, you can upload data without
    knowing the size before starting the transfer if you use chunked
    encoding. You enable this by adding a header like
    "Transfer-Encoding: chunked" with CURLOPT_HTTPHEADER.

In fact, libcurl adds this header itself. Actually we need to avoid
adding this header by libcurl with `CURLOPT_INFILESIZE` [2].

The CURLOPT_UPLOAD documentation has been updated [3].

1. https://github.com/curl/curl/blob/555bacd6d522bcca497573765056354f4d5d7b33/docs/libcurl/opts/CURLOPT_UPLOAD.3
2. https://curl.se/libcurl/c/httpput.html
3. curl/curl#11300

Closes tarantool#8744

NO_DOC=bugfix
oleg-jukovec added a commit to oleg-jukovec/tarantool that referenced this pull request Jun 12, 2023
The description of CURLOPT_UPLOAD [1] is confusing:

    If you use PUT to an HTTP 1.1 server, you can upload data without
    knowing the size before starting the transfer if you use chunked
    encoding. You enable this by adding a header like
    "Transfer-Encoding: chunked" with CURLOPT_HTTPHEADER.

In fact, libcurl adds this header itself. Actually we need to avoid
adding this header by libcurl with CURLOPT_INFILESIZE [2].

The CURLOPT_UPLOAD documentation has been updated [3].

1. https://github.com/curl/curl/blob/555bacd6d522bcca497573765056354f4d5d7b33/docs/libcurl/opts/CURLOPT_UPLOAD.3
2. https://curl.se/libcurl/c/httpput.html
3. curl/curl#11300

Closes tarantool#8744

NO_DOC=bugfix
bagder added a commit that referenced this pull request Jun 12, 2023
oleg-jukovec added a commit to oleg-jukovec/tarantool that referenced this pull request Jun 13, 2023
The description of CURLOPT_UPLOAD [1] is confusing:

    If you use PUT to an HTTP 1.1 server, you can upload data without
    knowing the size before starting the transfer if you use chunked
    encoding. You enable this by adding a header like
    "Transfer-Encoding: chunked" with CURLOPT_HTTPHEADER.

In fact, libcurl adds this header itself. Actually we need to avoid
adding this header by libcurl with CURLOPT_INFILESIZE [2].

The CURLOPT_UPLOAD documentation has been updated [3].

1. https://github.com/curl/curl/blob/555bacd6d522bcca497573765056354f4d5d7b33/docs/libcurl/opts/CURLOPT_UPLOAD.3
2. https://curl.se/libcurl/c/httpput.html
3. curl/curl#11300

Closes tarantool#8744

NO_DOC=bugfix
oleg-jukovec added a commit to oleg-jukovec/tarantool that referenced this pull request Jun 21, 2023
The description of CURLOPT_UPLOAD [1] is confusing:

    If you use PUT to an HTTP 1.1 server, you can upload data without
    knowing the size before starting the transfer if you use chunked
    encoding. You enable this by adding a header like
    "Transfer-Encoding: chunked" with CURLOPT_HTTPHEADER.

In fact, libcurl adds this header itself. Actually we need to avoid
adding this header by libcurl with CURLOPT_INFILESIZE [2].

The CURLOPT_UPLOAD documentation has been updated [3].

1. https://github.com/curl/curl/blob/555bacd6d522bcca497573765056354f4d5d7b33/docs/libcurl/opts/CURLOPT_UPLOAD.3
2. https://curl.se/libcurl/c/httpput.html
3. curl/curl#11300

Closes tarantool#8744

NO_DOC=bugfix
Totktonada pushed a commit to tarantool/tarantool that referenced this pull request Jun 21, 2023
The description of CURLOPT_UPLOAD [1] is confusing:

    If you use PUT to an HTTP 1.1 server, you can upload data without
    knowing the size before starting the transfer if you use chunked
    encoding. You enable this by adding a header like
    "Transfer-Encoding: chunked" with CURLOPT_HTTPHEADER.

In fact, libcurl adds this header itself. Actually we need to avoid
adding this header by libcurl with CURLOPT_INFILESIZE [2].

The CURLOPT_UPLOAD documentation has been updated [3].

1. https://github.com/curl/curl/blob/555bacd6d522bcca497573765056354f4d5d7b33/docs/libcurl/opts/CURLOPT_UPLOAD.3
2. https://curl.se/libcurl/c/httpput.html
3. curl/curl#11300

Closes #8744

NO_DOC=bugfix
Totktonada pushed a commit to tarantool/tarantool that referenced this pull request Jun 21, 2023
The description of CURLOPT_UPLOAD [1] is confusing:

    If you use PUT to an HTTP 1.1 server, you can upload data without
    knowing the size before starting the transfer if you use chunked
    encoding. You enable this by adding a header like
    "Transfer-Encoding: chunked" with CURLOPT_HTTPHEADER.

In fact, libcurl adds this header itself. Actually we need to avoid
adding this header by libcurl with CURLOPT_INFILESIZE [2].

The CURLOPT_UPLOAD documentation has been updated [3].

1. https://github.com/curl/curl/blob/555bacd6d522bcca497573765056354f4d5d7b33/docs/libcurl/opts/CURLOPT_UPLOAD.3
2. https://curl.se/libcurl/c/httpput.html
3. curl/curl#11300

Closes #8744

NO_DOC=bugfix

(cherry picked from commit e2e5ef4)
bch pushed a commit to bch/curl that referenced this pull request Jul 19, 2023
The behavior of CURLOPT_UPLOAD differs from what is described in the
documentation. The option automatically adds the 'Transfer-Encoding:
chunked' header if the upload size is unknown.

Closes curl#11300
bch pushed a commit to bch/curl that referenced this pull request Jul 19, 2023
ptitSeb pushed a commit to wasix-org/curl that referenced this pull request Sep 25, 2023
The behavior of CURLOPT_UPLOAD differs from what is described in the
documentation. The option automatically adds the 'Transfer-Encoding:
chunked' header if the upload size is unknown.

Closes curl#11300
ptitSeb pushed a commit to wasix-org/curl that referenced this pull request Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants