ledgetech / ledgetech/lua-resty-http
bug: wrong trailer format parsing
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 2.1k
- Forks
- 630
- PR merge metrics
- No merged PRs in 30d
Description
The trailer headers should be in the following format:
...<body>...
0\r\n
Trailer-Header-A: foo\r\n
...
\r\n
However, the code thought there is an extra \r\n between 0\r\n and Trailer-Header-A: foo\r\n, so it consumes two more chars from the first header at the end of chunked body parsing, then the first parsed header becomes a truncated version: ailer-Header-A: foo\r\n.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect the chunked-body trailer parsing in lib/resty/http.lua around lines 486-489 and the existing cases in t/04-trailers.t around lines 79-86. Run the trailer tests first, then verify parsing against the HTTP Trailer format shown in the issue. Done means the first trailer header is preserved rather than losing its first two characters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- api, networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100