Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This fails:

$ curl --trace multipart-fail.log -F "source={}" http://127.0.0.1:3003/jslint

With a squid status 417 error, ERR_INVALID_REQ.

I've never had this in practice through a web browser, so it's probably curl usage instead of squid, but if I tell curl not to use the squid proxy, the web application on the other end accepts it just fine.

(If there's a more appropriate StackExchange site for this, please let me know.)

share|improve this question

migrated from superuser.com Jan 30 '10 at 7:44

This question came from our site for computer enthusiasts and power users.

    
Should probably go on ServerFault. –  Josh K Jan 29 '10 at 20:43
add comment

4 Answers 4

up vote 4 down vote accepted

Squid doesn't support Expect: 100-continue, being a HTTP/1.0 device. Notice the response status code 417 Expectation failed.

Curl should retry the request automatically, but it doesn't; instead, you need to suppress the Expect header; e.g.,

curl -H "Expect:" --trace multipart-fail.log -F "source={}" http://127.0.0.1:3003/jslint
share|improve this answer
add comment

For anyone who stumbles across this question and is getting the same problem with cURL in PHP (not the command line), try adding this line:

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));

It worked for me.

share|improve this answer
add comment

Alternatively you can configure Squid to simply ignore that request header...

Add in squid.conf: ignore_expect_100 on

http://www.squid-cache.org/Doc/config/ignore_expect_100/

share|improve this answer
add comment

After a long time I fixed this issue in the following manner..

//proxy server address
        $proxyServer="192.168.43.201";
//Proxy server port
        $proxyPort="3128";

     curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);
     curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
     curl_setopt($ch, CURLOPT_PROXY, "$proxyServer:$proxyPort");

Reff: http://djzone.im/2010/05/php-curl-ntlm-squid-proxy-authentication/

Hope this helps someone...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.