aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_parse.c')
-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 69528690c..15bdb6189 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -338,6 +338,7 @@ int ngx_read_http_header_line(ngx_http_request_t *r, ngx_hunk_t *h)
sw_space_after_value,
sw_almost_done,
sw_header_almost_done,
+ sw_ignore_line,
sw_done,
sw_header_done
} state;
@@ -404,6 +405,14 @@ int ngx_read_http_header_line(ngx_http_request_t *r, ngx_hunk_t *h)
break;
}
+ if (ch == '/') {
+ /* IIS can send duplicate "HTTP/1.1 ..." lines */
+ if (r->proxy && ngx_strncmp(r->header_start, "HTTP", 4) == 0) {
+ state = sw_ignore_line;
+ break;
+ }
+ }
+
return NGX_HTTP_PARSE_INVALID_HEADER;
/* space* before header value */
@@ -461,6 +470,17 @@ int ngx_read_http_header_line(ngx_http_request_t *r, ngx_hunk_t *h)
}
break;
+ /* ignore header line */
+ case sw_ignore_line:
+ switch (ch) {
+ case LF:
+ state = sw_start;
+ break;
+ default:
+ break;
+ }
+ break;
+
/* end of header line */
case sw_almost_done:
switch (ch) {