cURL / Mailing Lists / curl-library / Single Mail


Re: Content-Length and Proxy

From: Daniel Stenberg <>
Date: Wed, 16 Jan 2013 23:09:00 +0100 (CET)

On Wed, 16 Jan 2013, Jeroen Venderbosch wrote:

> Sending of Post/Get request by using the curl implementation of PHP. A https
> connection is set up with a proxy-server in between. Original Post/Get
> requests become CONNECT requests by curl. CONNECT requests arrive at the
> proxy-server with a Content-Length field set.

How come there's a Content-Length header there in the first place?

And which libcurl version are you using?

> Question: Why does (lib)curl set the Content-Length field on a CONNECT
> request?

It doesn't. I think you are!

> Is this combination not allowed according to the W3-standards?

Since we don't intend to send any body in the CONNECT request it shouldn't
have any such header, no.

See also my (pending) CURLOPT_PROXYHEADER patch that might be a fix to what
you experiencing:

List admin:
Received on 2013-01-16