diff options
Diffstat (limited to 'src/http/ngx_http_parse.c')
| -rw-r--r-- | src/http/ngx_http_parse.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c index 4dfeb4bcf..059edae44 100644 --- a/src/http/ngx_http_parse.c +++ b/src/http/ngx_http_parse.c @@ -383,21 +383,18 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b) case sw_host_end: + if (ch == ':') { + state = sw_port; + break; + } + r->host_end = p; if (r->method == NGX_HTTP_CONNECT) { - if (ch == ':') { - state = sw_port; - break; - } - return NGX_HTTP_PARSE_INVALID_REQUEST; } switch (ch) { - case ':': - state = sw_port; - break; case '/': r->uri_start = p; state = sw_after_slash_in_uri; @@ -465,14 +462,11 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b) case sw_port: if (ch >= '0' && ch <= '9') { - if (r->port >= 6553 && (r->port > 6553 || (ch - '0') > 5)) { - return NGX_HTTP_PARSE_INVALID_REQUEST; - } - - r->port = r->port * 10 + (ch - '0'); break; } + r->host_end = p; + if (r->method == NGX_HTTP_CONNECT) { if (ch == ' ') { state = sw_http_09; |
