﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
2574	"core module ""ngx_http_set_etag"" function doesn't set etag lowcase_key field."	Itai Segev		"In nginx-1.23.3/src/http/ngx_http_core_module.c , ""ngx_http_set_etag"" function adds the ""ETag"" header to response but does not initialize the header lowcase_key par: ""etag->lowcase_key"" and not nullify it either so we can't null-check it and know if it is unset in our module code.

I suggest to initialize the lowcase_key while initializing ""etag"" variable in ""ngx_http_set_etag"" function and have two options for that

1. 
   etag->lowcase_key= ngx_pnalloc(r->pool, strlen(""etag"") + 1);
   strcpy((char*) etag->lowcase_key, ""etag"");

2. 
   etag->lowcase_key=(u_char*)""etag"";
   r->headers_out.etag = etag;

I think the first option is safer because we don't cast the string literal const to u_char* 

If for some reason bug reviewer thinks we shouldn't init the lowcase_key just nullifying will also help. "	defect	closed	minor		nginx-core	1.23.x	invalid		Itai Segev	Linux f9ae48be22b0 5.15.49-linuxkit-pr #1 SMP Thu May 25 07:17:40 UTC 2023 x86_64 Linux	nginx version: nginx/1.23.3
