ledgetech / ledgetech/lua-resty-http

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

Open
#32 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
2.1k
Forks
630
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/resty/http.lua at the referenced lines around _handle_continue and the Expect header checks. Compare handling of case-insensitive Expect values, optional headers in 100 responses, and unsolicited 100 responses with the cited RFC sections. Done means all three reported cases are handled correctly and the existing tests or reproductions pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, nginx
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.