diff options
author | Valentin Bartenev <vbart@nginx.com> | 2018-03-15 21:08:29 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2018-03-15 21:08:29 +0300 |
commit | 701a54c177466c9cbcb82f68c27880281850bd93 (patch) | |
tree | cad3cebe3ca5c5fc889752ed2824b48631a5693f /src/nxt_http_parse.c | |
parent | 0b628bfe484d1262d37e5043cad9f7a326d0d5e4 (diff) | |
download | unit-701a54c177466c9cbcb82f68c27880281850bd93.tar.gz unit-701a54c177466c9cbcb82f68c27880281850bd93.tar.bz2 |
HTTP parser: excluding leading and trailing tabs from field values.
As required by RFC 7230.
Diffstat (limited to 'src/nxt_http_parse.c')
-rw-r--r-- | src/nxt_http_parse.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nxt_http_parse.c b/src/nxt_http_parse.c index 2bd821b8..05254506 100644 --- a/src/nxt_http_parse.c +++ b/src/nxt_http_parse.c @@ -618,7 +618,9 @@ nxt_http_parse_field_value(nxt_http_request_parse_t *rp, u_char **pos, return NXT_AGAIN; } - if (*p != ' ') { + ch = *p; + + if (ch != ' ' && ch != '\t') { break; } @@ -662,7 +664,8 @@ nxt_http_parse_field_value(nxt_http_request_parse_t *rp, u_char **pos, *pos = p; if (nxt_fast_path(p != start)) { - while (p[-1] == ' ') { + + while (p[-1] == ' ' || p[-1] == '\t') { p--; } } |