cURL / Mailing Lists / curl-library / Single Mail


Re: Content-Length and Proxy

From: Jeroen Venderbosch <>
Date: Thu, 17 Jan 2013 09:02:54 +0100

Thanks for the quick reply.

Jeroen Venderbosch
Software engineer

WoodWing Software
The Netherlands

Direct +31 75 61 69 946
Office +31 75 61 43 400
Fax +31 75 61 43 399

On Jan 16, 2013, at 11:09 PM, Daniel Stenberg wrote:

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

        I make use of the Zend Framework. We use their Http Client with Curl adapter. I do a POST/GET request and in case of a POST the Http Client adds a Content-Length header. Next curl is called to do the request. The POST is 'transformed' into a CONNECT but the Content-Length header remains. So maybe something in the Framework should be changed to remove Content-Length in case a proxy-server is used?
> 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!
        You are right (in fact the Http Client of Zend Framework).
>> 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:
> Etiquette:

List admin:

  • application/pkcs7-signature attachment: smime.p7s
Received on 2013-01-17