openresty / openresty/lua-nginx-module
ngx.exit(ngx.HTTP_CONTINUE) not be processed
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 11.8k
- Forks
- 2.1k
- Avg merge
- 6h 1m
- Merged PRs (30d)
- 6
Description
Hi openresty team:
I use this configure
location /test {
content_by_lua_block {
ngx.exit(ngx.HTTP_CONTINUE)
}
}
then
➜ ~ curl 127.0.0.1/test -vv
* Trying 127.0.0.1:80...
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> GET /test HTTP/1.1
> Host: 127.0.0.1
> User-Agent: curl/7.74.0
> Accept: */*
>
* Empty reply from server
* Connection #0 to host 127.0.0.1 left intact
it doesn't have any response, in HTTP RFC explains, it will return the HTTP header to the client and then wait for the client to send data.
I read the source code, https://github.com/openresty/lua-nginx-module/blob/master/src/ngx_http_lua_util.c#L2432 it just send header in exit_code > ngx.HTTP_OK , this is not expected in HTTP Standard doc, There is a little conflict in the ngx.exit() function semantic. I think we can support HTTP 1xx code or explain this limitation in doc and forbidden in this function. if openresty can accept this solution, I can help to contribute code do this.
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 with the reproduction in the issue and inspect ngx_http_lua_util.c around line 2432, where ngx.exit() handles the exit code. Compare the current behavior for ngx.HTTP_CONTINUE with the HTTP expectation described in the issue. Done means either supporting the stated 1xx response behavior or documenting and enforcing the limitation, subject to a project decision.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, lua, nginx
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100