From: William A. Rowe Jr Date: Wed, 16 Jan 2019 16:37:41 +0000 (+0000) Subject: mod_negotiation: LanguagePriority tags must be treated case-insensitive, X-Git-Tag: 2.4.38~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9f27fb083ba60cf2781f3dc6a30c0690bf32667;p=thirdparty%2Fapache%2Fhttpd.git mod_negotiation: LanguagePriority tags must be treated case-insensitive, per https://tools.ietf.org/html/rfc7231#section-3.1.3.1 PR: 39730 Backports: r1850989 Submitted by: jailletc36 Reviewed by: jailletc36, wrowe, jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1851468 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 4b0a07fdcf5..e3f54764e8c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.4.38 + *) mod_negotiation: Treat LanguagePriority as case-insensitive to match + AddLanguage behavior and HTTP specification. PR 39730 [Christophe Jaillet] + *) mod_md: incorrect behaviour when synchronizing ongoing ACME challenges have been fixed. [Michael Kaufmann, Stefan Eissing] diff --git a/STATUS b/STATUS index e5a7eb654a1..68b1473c0bb 100644 --- a/STATUS +++ b/STATUS @@ -213,12 +213,6 @@ PATCHES PROPOSED TO BACKPORT FROM TRUNK: 2.4.x patch: svn merge -c 1851093 ^/httpd/httpd/trunk . +1: jailletc36 (by inspection), jim - *) mod_negotiation: LanguagePriority tags must be treated case-insensitive, - per https://tools.ietf.org/html/rfc7231#section-3.1.3.1 PR 39730 - trunk patch: http://svn.apache.org/r1850989 - 2.4.x patch: svn merge -c 1850989 ^/httpd/httpd/trunk . - +1: jailletc36, wrowe, jim - *) easy proposals: - mod_authn_dbm: Return APR_SUCCESS which is equivalent but more readable than 'rv' here diff --git a/modules/mappers/mod_negotiation.c b/modules/mappers/mod_negotiation.c index 3f04d83ddf0..b6dfedc6c0e 100644 --- a/modules/mappers/mod_negotiation.c +++ b/modules/mappers/mod_negotiation.c @@ -1459,7 +1459,7 @@ static int find_lang_index(apr_array_header_t *accept_langs, char *lang) alang = (const char **) accept_langs->elts; for (i = 0; i < accept_langs->nelts; ++i) { - if (!strncmp(lang, *alang, strlen(*alang))) { + if (!ap_cstr_casecmpn(lang, *alang, strlen(*alang))) { return i; } alang += (accept_langs->elt_size / sizeof(char*));