mirror of
https://github.com/nginx/nginx.git
synced 2026-02-03 20:29:27 -05:00
HTTP: Consider tab as whitespace in field value
HTTP considers 0x09 (horizontal tab) to be valid horizontal whitespace in a field value, and there are badly-behaved clients in the wild that rely on this behavior and cannot be fixed. This also ensures that NGINX is not itself such a badly-behaved client and that, for HTTP/1.x requests, the values of the $http_* variables agree with what upstream servers will see. Fixes: #187
This commit is contained in:
parent
9785db9bd5
commit
40948bea5f
1 changed files with 3 additions and 0 deletions
|
|
@ -972,6 +972,7 @@ ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b,
|
|||
case sw_space_before_value:
|
||||
switch (ch) {
|
||||
case ' ':
|
||||
case '\t':
|
||||
break;
|
||||
case CR:
|
||||
r->header_start = p;
|
||||
|
|
@ -996,6 +997,7 @@ ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b,
|
|||
case sw_value:
|
||||
switch (ch) {
|
||||
case ' ':
|
||||
case '\t':
|
||||
r->header_end = p;
|
||||
state = sw_space_after_value;
|
||||
break;
|
||||
|
|
@ -1016,6 +1018,7 @@ ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b,
|
|||
case sw_space_after_value:
|
||||
switch (ch) {
|
||||
case ' ':
|
||||
case '\t':
|
||||
break;
|
||||
case CR:
|
||||
state = sw_almost_done;
|
||||
|
|
|
|||
Loading…
Reference in a new issue