lua-resty-http icon indicating copy to clipboard operation
lua-resty-http copied to clipboard

Question: 100-continue response timeout?

Open zhangcunli opened this issue 5 years ago • 2 comments

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?

zhangcunli avatar Mar 01 '19 12:03 zhangcunli

I think a 100-continue timeout interface is required.

zhangcunli avatar Mar 05 '19 07:03 zhangcunli

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.

astromechza avatar Jan 16 '20 12:01 astromechza