mirror of
https://github.com/nginx/nginx.git
synced 2026-06-29 21:31:51 +00:00
HTTP/1.x: Strip leading and trailing tabs from header values
RFC9112 includes SP and HTAB in OWS and requires leading and trailing OWS to be stripped from field values. Part of #187, but only for HTTP/1.x.
This commit is contained in:
parent
d44205284f
commit
df29d967bb
1 changed files with 3 additions and 0 deletions
|
|
@ -1027,6 +1027,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;
|
||||
|
|
@ -1051,6 +1052,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;
|
||||
|
|
@ -1071,6 +1073,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…
Add table
Add a link
Reference in a new issue