aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-10-26 11:34:10 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-10-26 11:34:10 +0000
commit81924e8e168f5ccb16a52a57806aba921aa46f55 (patch)
tree1a7ee7cb4b81a246a73f105bf5d6d889a9af2557 /src
parent31fd642c5c492c360ba7649b02c64a624fbe7e30 (diff)
downloadnginx-81924e8e168f5ccb16a52a57806aba921aa46f55.tar.gz
nginx-81924e8e168f5ccb16a52a57806aba921aa46f55.zip
compatibility with mget: space after HTTP/1.1
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_parse.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
index 256bd9be9..66bd36eea 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -124,6 +124,7 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
sw_major_digit,
sw_first_minor_digit,
sw_minor_digit,
+ sw_spaces_after_digit,
sw_almost_done
} state;
@@ -636,6 +637,11 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
goto done;
}
+ if (ch == ' ') {
+ state = sw_spaces_after_digit;
+ break;
+ }
+
if (ch < '0' || ch > '9') {
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';
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 */
case sw_almost_done:
r->request_end = p - 1;