aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2020-06-30 15:32:09 +0300
committerRoman Arutyunyan <arut@nginx.com>2020-06-30 15:32:09 +0300
commitd839fee75f5247c160c0b7b927dc45a3122cb6a2 (patch)
treeb4a3411b344a680a6cf9e0b7fff465c6da0d62f4 /src/http/ngx_http_request.c
parent707117276ed252e39c75769a140cbac6e18eb74a (diff)
downloadnginx-d839fee75f5247c160c0b7b927dc45a3122cb6a2.tar.gz
nginx-d839fee75f5247c160c0b7b927dc45a3122cb6a2.zip
HTTP/3: set r->headers_in.chunked flag after parsing headers.
Previously it was set when creating the request object. The side-effect was trying to discard the request body in case of header parse error.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index c953386d4..8933bb3c3 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -727,7 +727,6 @@ ngx_http_alloc_request(ngx_connection_t *c)
#if (NGX_HTTP_V3)
if (hc->quic) {
r->http_version = NGX_HTTP_VERSION_30;
- r->headers_in.chunked = 1;
}
#endif
@@ -2155,6 +2154,12 @@ ngx_http_process_request_header(ngx_http_request_t *r)
}
}
+#if (NGX_HTTP_V3)
+ if (r->http_version == NGX_HTTP_VERSION_30) {
+ r->headers_in.chunked = 1;
+ }
+#endif
+
if (r->headers_in.connection_type == NGX_HTTP_CONNECTION_KEEP_ALIVE) {
if (r->headers_in.keep_alive) {
r->headers_in.keep_alive_n =