]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_http2: use ap_cstr_casecmpn for check header names trunk trunk
authorStefan Eissing <icing@apache.org>
Tue, 4 Nov 2025 16:54:07 +0000 (16:54 +0000)
committerStefan Eissing <icing@apache.org>
Tue, 4 Nov 2025 16:54:07 +0000 (16:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1929527 13f79535-47bb-0310-9956-ffa450edef68

modules/http2/h2_util.c

index 8c1597dadc5732f1f9a4262fad9d88e2c90073f3..b377ff77f1b1955c07475f99b50a7bf3e0095af8 100644 (file)
@@ -1650,7 +1650,7 @@ static int contains_name(const literal *lits, size_t llen, nghttp2_nv *nv)
     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_table_t *headers, apr_pool_t *pool,
         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_table_t *headers, apr_pool_t *pool,
         }
     }
     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 */
         }