Tuesday, November 22, 2011

squid: 417 Expectation Failed

Many applications rely on using a special HTTP/1.1 header (Expect: 100-continue) when doing a POST, which is not happily supported by Squid.
RFC2616 says:
The purpose of the 100 (Continue) status (see section 10.1.1) is to allow a client that is sending a request message with a request body to determine if the origin server is willing to accept the request (based on the request headers) before the client sends the request body. In some cases, it might either be inappropriate or highly inefficient for the client to send the body if the server will reject the message without looking at the body. 
We can configure Squid to simply ignore that request header, and usually client with poor error handling will fallback without even notice it.
Add in squid.conf:
ignore_expect_100 on
and restart (reload) squid

No comments: