cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Content-Length and Proxy

From: Jeroen Venderbosch <jve_at_woodwing.com>
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
http://www.WoodWing.com

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?
        7.28.1
>
>> 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.
        Clear.
>
> See also my (pending) CURLOPT_PROXYHEADER patch that might be a fix to what you experiencing:
>
> http://curl.haxx.se/mail/lib-2012-09/0059.html
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

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