openresty / openresty/lua-nginx-module
huge size response via ngx.location.capture has been truncated
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 11.8k
- Forks
- 2.1k
- Avg merge
- 6h 1m
- Merged PRs (30d)
- 6
Description
the size of this response is more than 80k, ngx.location.capture return with status 200 and truncate false, but in fact it has been truncated, which i can get full response from upstream via directly curl.
i use json_decode(from cjosn) decode the response above, but it throw exceptions like " Expected comma or object end but found T_END at character 88993" or "Expected object key string but found unexpected end of string at character 91105", so I suspect it has been truncated.
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 reproducing the issue with ngx.location.capture against an upstream response larger than 80k, then compare the returned body and truncate status with a direct curl response. Trace the ngx.location.capture implementation and existing tests; done means the full response is returned or truncation is reported accurately, with the JSON decoding failure no longer occurring.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, lua
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100