-
Notifications
You must be signed in to change notification settings - Fork 2k
bugfix: first part headers will be discard when using single LF as delimiter #1204
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -876,3 +876,115 @@ Foo: bar\r | |
--- no_error_log | ||
[error] | ||
--- timeout: 5 | ||
|
||
|
||
|
||
=== TEST 30: large headers(using single LF as line break) | ||
--- config | ||
location /t { | ||
content_by_lua_block { | ||
ngx.print(ngx.req.raw_header()) | ||
} | ||
} | ||
|
||
--- raw_request eval | ||
"GET /t HTTP/1.1 | ||
Host: localhost | ||
Connection: close | ||
". | ||
(CORE::join "\n", map { "Header$_: value-$_" } 1..512) . "\n\n" | ||
|
||
--- response_body eval | ||
qq{GET /t HTTP/1.1 | ||
Host: localhost | ||
Connection: close | ||
} | ||
.(CORE::join "\n", map { "Header$_: value-$_" } 1..512) . "\n\n" | ||
|
||
--- no_error_log | ||
[error] | ||
--- timeout: 5 | ||
|
||
|
||
|
||
=== TEST 31: large headers without request line(using single LF as line break) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better add a space before |
||
--- config | ||
location /t { | ||
content_by_lua_block { | ||
ngx.print(ngx.req.raw_header(true)) | ||
} | ||
} | ||
|
||
--- raw_request eval | ||
"GET /t HTTP/1.1 | ||
Host: localhost | ||
Connection: close | ||
". | ||
(CORE::join "\n", map { "Header$_: value-$_" } 1..512) . "\n\n" | ||
|
||
--- response_body eval | ||
qq{Host: localhost | ||
Connection: close | ||
} | ||
.(CORE::join "\n", map { "Header$_: value-$_" } 1..512) . "\n\n" | ||
|
||
--- no_error_log | ||
[error] | ||
--- timeout: 5 | ||
|
||
|
||
|
||
=== TEST 32: large headers with leading CRLF(using single LF as line break) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. |
||
--- config | ||
location /t { | ||
content_by_lua_block { | ||
ngx.print(ngx.req.raw_header()) | ||
} | ||
} | ||
|
||
--- raw_request eval | ||
"\r | ||
GET /t HTTP/1.1 | ||
Host: localhost | ||
Connection: close | ||
". | ||
(CORE::join "\n", map { "Header$_: value-$_" } 1..512) . "\n\n" | ||
|
||
--- response_body eval | ||
qq{GET /t HTTP/1.1 | ||
Host: localhost | ||
Connection: close | ||
} | ||
.(CORE::join "\n", map { "Header$_: value-$_" } 1..512) . "\n\n" | ||
|
||
--- no_error_log | ||
[error] | ||
--- timeout: 5 | ||
|
||
|
||
|
||
=== TEST 33: large headers without request line but contains leading CRLF(using single LF as line break) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. |
||
--- config | ||
location /t { | ||
content_by_lua_block { | ||
ngx.print(ngx.req.raw_header(true)) | ||
} | ||
} | ||
|
||
--- raw_request eval | ||
"\r | ||
GET /t HTTP/1.1 | ||
Host: localhost | ||
Connection: close | ||
". | ||
(CORE::join "\n", map { "Header$_: value-$_" } 1..512) . "\n\n" | ||
|
||
--- response_body eval | ||
qq{Host: localhost | ||
Connection: close | ||
} | ||
.(CORE::join "\n", map { "Header$_: value-$_" } 1..512) . "\n\n" | ||
|
||
--- no_error_log | ||
[error] | ||
--- timeout: 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like below.