mirror of
https://github.com/nginx/nginx.git
synced 2025-01-21 13:53:08 -06:00
compatibility with mget: space after HTTP/1.1
This commit is contained in:
parent
31fd642c5c
commit
81924e8e16
@ -124,6 +124,7 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
|
|||||||
sw_major_digit,
|
sw_major_digit,
|
||||||
sw_first_minor_digit,
|
sw_first_minor_digit,
|
||||||
sw_minor_digit,
|
sw_minor_digit,
|
||||||
|
sw_spaces_after_digit,
|
||||||
sw_almost_done
|
sw_almost_done
|
||||||
} state;
|
} state;
|
||||||
|
|
||||||
@ -636,6 +637,11 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ch == ' ') {
|
||||||
|
state = sw_spaces_after_digit;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (ch < '0' || ch > '9') {
|
if (ch < '0' || ch > '9') {
|
||||||
return NGX_HTTP_PARSE_INVALID_REQUEST;
|
return NGX_HTTP_PARSE_INVALID_REQUEST;
|
||||||
}
|
}
|
||||||
@ -643,6 +649,20 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
|
|||||||
r->http_minor = r->http_minor * 10 + ch - '0';
|
r->http_minor = r->http_minor * 10 + ch - '0';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case sw_spaces_after_digit:
|
||||||
|
switch (ch) {
|
||||||
|
case ' ':
|
||||||
|
break;
|
||||||
|
case CR:
|
||||||
|
state = sw_almost_done;
|
||||||
|
break;
|
||||||
|
case LF:
|
||||||
|
goto done;
|
||||||
|
default:
|
||||||
|
return NGX_HTTP_PARSE_INVALID_REQUEST;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
/* end of request line */
|
/* end of request line */
|
||||||
case sw_almost_done:
|
case sw_almost_done:
|
||||||
r->request_end = p - 1;
|
r->request_end = p - 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user