]> git.kaiwu.me - nginx.git/commitdiff
Clean up trailers in ngx_http_clean_header() as well.
authorSergey Kandaurov <pluknet@nginx.com>
Tue, 26 Jan 2021 09:39:28 +0000 (12:39 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Tue, 26 Jan 2021 09:39:28 +0000 (12:39 +0300)
The function has not been updated with introduction of trailers support
in 7034:1b068a4e82d8 (1.13.2).

src/http/ngx_http_special_response.c

index 76e6705889f8715bc83371c9111025983a134c45..72f56fd9adc5b86006fc450c0961630a6f9ee5cd 100644 (file)
@@ -575,6 +575,10 @@ ngx_http_clean_header(ngx_http_request_t *r)
     r->headers_out.headers.part.next = NULL;
     r->headers_out.headers.last = &r->headers_out.headers.part;
 
+    r->headers_out.trailers.part.nelts = 0;
+    r->headers_out.trailers.part.next = NULL;
+    r->headers_out.trailers.last = &r->headers_out.trailers.part;
+
     r->headers_out.content_length_n = -1;
     r->headers_out.last_modified_time = -1;
 }