Request data can be read only once
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 81
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
If I call req:param() then req:json() will fail subsequently, because it won't be able to read the request body using req:read(), because req:read() is not reentrant.
Request body should be cached somewhere. At least if content-type is application/json
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
Start by tracing req:param(), req:json(), and req:read() to understand why reading the request body is not reentrant. Check how application/json requests are handled, then verify that calling req:param() followed by req:json() can read the body successfully without changing behavior for other request types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100