Skip to content

Commit 148c6b5

Browse files
committed
mod_http2: use ap_cstr_casecmpn for check header names
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1929527 13f79535-47bb-0310-9956-ffa450edef68
1 parent fe33bd5 commit 148c6b5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/http2/h2_util.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,7 +1650,7 @@ static int contains_name(const literal *lits, size_t llen, nghttp2_nv *nv)
16501650
for (i = 0; i < llen; ++i) {
16511651
lit = &lits[i];
16521652
if (lit->len == nv->namelen
1653-
&& !ap_cstr_casecmp(lit->name, (const char *)nv->name)) {
1653+
&& !ap_cstr_casecmpn(lit->name, (const char *)nv->name, nv->namelen)) {
16541654
return 1;
16551655
}
16561656
}
@@ -1705,7 +1705,7 @@ static apr_status_t req_add_header(apr_table_t *headers, apr_pool_t *pool,
17051705
return APR_SUCCESS;
17061706
}
17071707
else if (nv->namelen == sizeof("cookie")-1
1708-
&& !ap_cstr_casecmp("cookie", (const char *)nv->name)) {
1708+
&& !ap_cstr_casecmpn("cookie", (const char *)nv->name, nv->namelen)) {
17091709
existing = apr_table_get(headers, "cookie");
17101710
if (existing) {
17111711
/* 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,
17231723
}
17241724
}
17251725
else if (nv->namelen == sizeof("host")-1
1726-
&& !ap_cstr_casecmp("host", (const char *)nv->name)) {
1726+
&& !ap_cstr_casecmpn("host", (const char *)nv->name, nv->namelen)) {
17271727
if (apr_table_get(headers, "Host")) {
17281728
return APR_SUCCESS; /* ignore duplicate */
17291729
}

0 commit comments

Comments
 (0)