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

I have an issue with Apache2 which I use as a proxy. My software sends HTTP PUT for protected resource with

Expect: 100-continue

Transfer-Encoding: chunked

And instead of getting '401 Unauthorized' I get '100 Continue'. After that my soft sends all chunks to server and then I get 401.

It looks like Apache does not forward headers and automatically sends '100 Continue'.

Is this correct behavior?

Here is what I found here

If a proxy receives a request that includes an Expect request-
    header field with the "100-continue" expectation, and the proxy
    either knows that the next-hop server complies with HTTP/1.1 or
    higher, or does not know the HTTP version of the next-hop
    server, it MUST forward the request, including the Expect header
    field
share|improve this question

1 Answer 1

This question was asked already on stackoverflow.com ( http://stackoverflow.com/questions/3889574/apache-and-mod-proxy-not-handling-http-100-continue-from-client-http-417 ):

You could configure it this way:

<IfModule mod_headers.c>
  RequestHeader unset Expect early
</IfModule>

This will remove the Expect header, and the communication should work.

EDIT Please make sure, that the remote side is HTTP/1.1. In the same RFC you linked there is just one page after your cite this:

  - If the proxy knows that the version of the next-hop server is
    HTTP/1.0 or lower, it MUST NOT forward the request, and it MUST
    respond with a 417 (Expectation Failed) status.
share|improve this answer
    
No. This is different issue. I don't want to remove this header. If I do so I get 413 error. –  Kylo Aug 18 '11 at 14:19
    
@Kylo In the Topic, there are also mentioned two bugs, that prevent Apache to handle the header correctly. Thats the same issue –  Thomas Berger Aug 18 '11 at 14:55
    
Next hop is HTTP/1.1 for sure. So I assume it is Apache bug. Right? –  Kylo Aug 19 '11 at 6:13

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.