curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP POST/PUT request with NTLM authentication leads to HTTP Status 411 Length required

From: Isaac Boukris <iboukris_at_gmail.com>
Date: Fri, 3 Feb 2017 15:22:24 +0200

On Fri, Feb 3, 2017 at 12:11 PM, Hölzl, Dominik
<Dominik.Hoelzl_at_fabasoft.com> wrote:
> I have figured out what the problem is and how it is reproducible (Adopted
> from the POST example https://curl.haxx.se/libcurl/c/http-post.html):
>
> /* Add some headers, in this case a redundant Content-Length header */
>
> struct curl_slist *headers = NULL;
>
> headers = curl_slist_append(headers, "Content-Length: 24");
>
> curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
>
> If setting an additional Content-Length header (which is redundant as cURL
> controls the Content-Lenght header itself anyway), a Content-Length header
> is curiously NOT sent to the server in the NTLM challenge request.
>
>
>
> Removing the marked lines solves the problem.
>
>
>
> In cURL version 7.19.6 it also works if the superfluous Content-Length
> header is added.

Great. That was helpful to reproduce. I think I found a fix, have a look at:
https://github.com/curl/curl/pull/1242

p.s. please avoid top-posting, it makes it hard to follow, see
etiquette link below.

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-02-03