cURL

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1354 HTTP proxy gets confused by extra headers like a user-defined "Content-Type"

From: dvo <dvodvo_at_users.sf.net>
Date: Thu, 03 Apr 2014 16:20:45 +0000

---
** [bugs:#1354] HTTP proxy gets confused by extra headers like a user-defined "Content-Type"**
**Status:** open
**Created:** Thu Apr 03, 2014 04:20 PM UTC by dvo
**Last Updated:** Thu Apr 03, 2014 04:20 PM UTC
**Owner:** nobody
When using curl via an http proxy like cntlm or polipo and specifying the extra HTTP header "Content-Type", for instance
    curl --proxy http://myproxy:8080" http://server.com/ --data-binary @req.p10 -H "Content-Type: application/pkcs10"
the CONNECT command to the proxy blocks. 
As revealed using "--trace -", the problem is that the extra "Content-Type" header in
    CONNECT server.com HTTP/1.1 
    Host: server.com
    User-Agent: curl/7.36.0
    Proxy-Connection: Keep-Alive
    Content-Type: application/pkcs10
is not only useless, but disturbs the proxy. 
BTW, some proxies seem fine if there is additionally a "Content-Length" header, but this appears useless in the CONNECT message, too. 
Moreover, I'm not sure if the "Proxy-Connection: Keep-Alive" header is useful in this context, and for some reason it is inserted even when the --no-keepalive option is used.
After commenting out the following two code lines in lib/http_proxy.c 
        if(CURLE_OK == result)
          result = Curl_add_custom_headers(conn, req_buffer);
such that no user-defined headers are inserted in the CONNECT message (which, admittedly may be too drastic), the proxy connection gets through fine.
---
Sent from sourceforge.net because curl-tracker@cool.haxx.se is subscribed to https://sourceforge.net/p/curl/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/curl/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
Received on 2014-04-03

These mail archives are generated by hypermail.

donate! Page updated March 21, 2014.
web site info

File upload with ASP.NET