diff src/http/modules/ngx_http_headers_filter_module.c @ 8031:d26db4f82d7d

All known output headers can be linked lists now. The h->next pointer properly provided as NULL in all cases where known output headers are added. Note that there are 3rd party modules which might not do this, and it might be risky to rely on this for arbitrary headers.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 30 May 2022 21:25:45 +0300
parents ef6a3a99a81a
children e64a1f32065b
line wrap: on
line diff
--- a/src/http/modules/ngx_http_headers_filter_module.c
+++ b/src/http/modules/ngx_http_headers_filter_module.c
@@ -362,6 +362,7 @@ ngx_http_set_expires(ngx_http_request_t 
         }
 
         r->headers_out.expires = e;
+        e->next = NULL;
 
         e->hash = 1;
         ngx_str_set(&e->key, "Expires");
@@ -621,6 +622,7 @@ ngx_http_set_response_header(ngx_http_re
         }
 
         *old = h;
+        h->next = NULL;
     }
 
     h->hash = 1;