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

fail to deal with request header Expect: 100-Continue and respone

Open guanglinlv opened this issue 9 years ago • 2 comments

hi @pintsized ,

Bug 1

the following point is case sensitive,so if the value of request header Expect has some upper character,we will make mistake without handle_continue;

Bug 2

_handle_continue only try to read an empty line,but there is some oter optional headers like Date or Content-length. see rfc2616-10.1 Informational 1xx.

Bug 3

http.lua#L557 only handle continue response when Expect: 100-continue request header is there.but as the RFC 2616 say:

- An origin server SHOULD NOT send a 100 (Continue) response if
the request message does not include an Expect request-header
field with the "100-continue" expectation, and MUST NOT send a
100 (Continue) response if such a request comes from an HTTP/1.0
(or earlier) client.

see RFC2616#sec8.2.3.

It's SHOULD NOT requirement,it would be nice if we support it.

I have made a fix and tested it ok.

thanks.

guanglinlv avatar Jun 16 '15 10:06 guanglinlv

@guanglinlv hi, can u publish your fix ?

pavelnemirovsky avatar Feb 10 '19 20:02 pavelnemirovsky

Hi, yes I think Bug 1 isn't an issue, but if we're missing some details in _handle_continue please do send a PR with some tests and I'll happily include them.

pintsized avatar Feb 11 '19 11:02 pintsized