我有一个Apache2的问题,我用它作为代理。 我的软件发送HTTP PUT保护资源
Expect: 100-continue Transfer-Encoding: chunked
而不是'401未经授权'我得到'100继续'。 之后,我的软件发送所有的块到服务器,然后我得到401。
它看起来像Apache不转发标题,并自动发送“100继续”。
这是正确的行为?
这里是我在这里find的
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
这个问题已经问stackoverflow.com( https://stackoverflow.com/questions/3889574/apache-and-mod-proxy-not-handling-http-100-continue-from-client-http-417 ):
你可以这样configuration它:
<IfModule mod_headers.c> RequestHeader unset Expect early </IfModule>
这将删除Expect标题,并且通信应该工作。
编辑请确定,远程端是HTTP / 1.1。 在你链接的同一个RFC中,只有一个页面在你引用这个之后:
- 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.