diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2005-03-22 16:11:23 +0000 |
|---|---|---|
| committer | Jonathan Kolb <jon@b0g.us> | 2005-03-22 16:11:23 +0000 |
| commit | 766b94b670a551c0a881dad06f7bc404c51607ee (patch) | |
| tree | 30ffd96d8209d6af8990ab701a1e4a62d7f62fee /src/http/ngx_http_parse.c | |
| parent | c70429eafad3bdd2172cc50f1b0507668ba0dfcc (diff) | |
| download | nginx-766b94b670a551c0a881dad06f7bc404c51607ee.tar.gz | |
Changes with nginx 0.1.26 22 Mar 2005v0.1.26
*) Change: the invalid client header lines are now ignored and logged
at the info level.
*) Change: the host name is also logged in error log.
*) Feature: the ngx_http_auth_basic_module module and the auth_basic
and auth_basic_user_file directives.
Diffstat (limited to 'src/http/ngx_http_parse.c')
| -rw-r--r-- | src/http/ngx_http_parse.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c index a7d8fe37f..7f031cf0d 100644 --- a/src/http/ngx_http_parse.c +++ b/src/http/ngx_http_parse.c @@ -497,9 +497,10 @@ ngx_int_t ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b) sw_space_before_value, sw_value, sw_space_after_value, + sw_ignore_line, + sw_skip_line, sw_almost_done, - sw_header_almost_done, - sw_ignore_line + sw_header_almost_done } state; state = r->state; @@ -511,6 +512,8 @@ ngx_int_t ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b) /* first char */ case sw_start: + r->invalid_header = 0; + switch (ch) { case CR: r->header_end = p; @@ -528,7 +531,7 @@ ngx_int_t ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b) break; } - if (ch == '-' || ch == '_' || ch == '~' || ch == '.') { + if (ch == '-') { break; } @@ -536,7 +539,9 @@ ngx_int_t ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b) break; } - return NGX_HTTP_PARSE_INVALID_HEADER; + r->invalid_header = 1; + state = sw_skip_line; + break; } break; @@ -554,7 +559,7 @@ ngx_int_t ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b) break; } - if (ch == '-' || ch == '_' || ch == '~' || ch == '.') { + if (ch == '-') { break; } @@ -572,7 +577,9 @@ ngx_int_t ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b) break; } - return NGX_HTTP_PARSE_INVALID_HEADER; + r->invalid_header = 1; + state = sw_skip_line; + break; /* space* before header value */ case sw_space_before_value: @@ -637,6 +644,21 @@ ngx_int_t ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b) } break; + /* skip header line */ + case sw_skip_line: + switch (ch) { + case CR: + r->header_end = p; + state = sw_almost_done; + break; + case LF: + r->header_end = p; + goto done; + default: + break; + } + break; + /* end of header line */ case sw_almost_done: switch (ch) { |
