lua-resty-http
lua-resty-http copied to clipboard
Question: 100-continue response timeout?
If http header contain “Expect": 100-contiue, and the server not response 100 OK. Then the lua-resty-http will block here:
local function _handle_continue(sock, body)
local status, version, reason, err = _receive_status(sock) --luacheck: no unused
///block here....
if not status then
return nil,nil,nil, err
end
How to do?
I think a 100-continue timeout interface is required.
We've just hit exactly the same issue here. According to HTTP 1.1 spec documents:
Because of the presence of older implementations, the protocol allows
ambiguous situations in which a client may send "Expect: 100-
continue" without receiving either a 417 (Expectation Failed) status
or a 100 (Continue) status. Therefore, when a client sends this
header field to an origin server (possibly via a proxy) from which it
has never seen a 100 (Continue) status, the client SHOULD NOT wait
for an indefinite period before sending the request body.
So I agree this can be seen as a bug.