]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
make sure, the preferred language gets its chance, even when it's not
authorAndré Malo <nd@apache.org>
Sun, 4 May 2003 23:40:20 +0000 (23:40 +0000)
committerAndré Malo <nd@apache.org>
Sun, 4 May 2003 23:40:20 +0000 (23:40 +0000)
listed in browser's accept-language list.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99709 13f79535-47bb-0310-9956-ffa450edef68

modules/mappers/mod_negotiation.c

index b2db9f4d815c860f3ce28cbd44b76b58f09f4650..1808d2862490c6f56c57f3caf739e78893477d77 100644 (file)
@@ -2379,7 +2379,16 @@ static int best_match(negotiation_state *neg, var_rec **pbest)
              * variant.
              */
             set_accept_quality(neg, variant);
-            set_language_quality(neg, variant);
+            /* accept the preferred language, even when it's not listed within
+             * the Accept-Language header
+             */
+            if (preferred_language) {
+                variant->lang_quality = 1.0f;
+                variant->definite = 1;
+            }
+            else {
+                set_language_quality(neg, variant);
+            }
             set_encoding_quality(neg, variant);
             set_charset_quality(neg, variant);