tarantool / tarantool/http

Request data can be read only once

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

Nobody has claimed this yet.

bug good first issue
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

  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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.