-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ngx.req.raw_header will emit some pre-read body in some edge cases #1200
Comments
@tokers That part is complicated and hacky. I don't really want to touch it myself. Pull requests welcome :) |
@agentzh OK, i will try :) |
@agentzh I found it is difficult to distinguish the pre-read body when the When the delimiter is the single LF, the first part headers will be discarded (with large headers). Pull request is here: #1204 |
@tokers Thanks for the investigations! Will have a look. |
@agentzh |
@spacewander I'd like to see what @tokers wants to say about this issue. |
@spacewander @agentzh There are two problems:
This part had been resolved by #1204
This is hard to fix due to the nginx core's design(such as positioning the pre-read body is difficult when the Since this case is relatively rare, i think we can close this issue now :). |
@tokers Thanks for the explanation! I'm closing this. |
Hi!
I found that
ngx.req.raw_header()
will emit some pre-read body, you can reproduce the problem by the following configuration:And with curl:
After it, we can find this in the error.log:
Because the nginx core's ngx_http_parse_header_line also thinks the request header lines are terminated when two "\n" are found. So i think the
ngx_http_lua_ngx_req_raw_header
should also be compatible with this situation?My local machine:
My OpenResty Version:
The text was updated successfully, but these errors were encountered: