You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2025/11/04 16:54:08 UTC
svn commit: r1929527 - httpd/httpd/trunk/modules/http2
Author: icing
Date: Tue Nov 4 16:54:07 2025
New Revision: 1929527
Log:
mod_http2: use ap_cstr_casecmpn for check header names
Modified:
httpd/httpd/trunk/modules/http2/h2_util.c
Modified: httpd/httpd/trunk/modules/http2/h2_util.c
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_util.c Tue Nov 4 16:39:35 2025 (r1929526)
+++ httpd/httpd/trunk/modules/http2/h2_util.c Tue Nov 4 16:54:07 2025 (r1929527)
@@ -1650,7 +1650,7 @@ static int contains_name(const literal *
for (i = 0; i < llen; ++i) {
lit = &lits[i];
if (lit->len == nv->namelen
- && !ap_cstr_casecmp(lit->name, (const char *)nv->name)) {
+ && !ap_cstr_casecmpn(lit->name, (const char *)nv->name, nv->namelen)) {
return 1;
}
}
@@ -1705,7 +1705,7 @@ static apr_status_t req_add_header(apr_t
return APR_SUCCESS;
}
else if (nv->namelen == sizeof("cookie")-1
- && !ap_cstr_casecmp("cookie", (const char *)nv->name)) {
+ && !ap_cstr_casecmpn("cookie", (const char *)nv->name, nv->namelen)) {
existing = apr_table_get(headers, "cookie");
if (existing) {
/* Cookie header come separately in HTTP/2, but need
@@ -1723,7 +1723,7 @@ static apr_status_t req_add_header(apr_t
}
}
else if (nv->namelen == sizeof("host")-1
- && !ap_cstr_casecmp("host", (const char *)nv->name)) {
+ && !ap_cstr_casecmpn("host", (const char *)nv->name, nv->namelen)) {
if (apr_table_get(headers, "Host")) {
return APR_SUCCESS; /* ignore duplicate */
}