diff --git a/mod_http2/h2_util.c b/mod_http2/h2_util.c index 8c1597da..b377ff77 100644 --- a/mod_http2/h2_util.c +++ b/mod_http2/h2_util.c @@ -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 */ }