Fixed "application/xhtml+xml" negotiation for undecided clients.
[MyWeb.git] / Web.pm
diff --git a/Web.pm b/Web.pm
index 2d8b988..456e7c8 100644 (file)
--- a/Web.pm
+++ b/Web.pm
@@ -737,17 +737,22 @@ my($class)=@_;
        #   Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b) Gecko/20050217
        my $mime=$class->Negotiate_choose([
                        # Put the fallback variant as the first one.
+                       # Rate both variants the same to prefer "text/html" for undecided clients.
+                       # At least
+                       #   Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b) Gecko/20050217
+                       # prefers "application/xhtml+xml" over "text/html" itself:
+                       #   text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
                        negotiate_variant(
                                        "id"=>"text/html",
                                        "content-type"=>"text/html",
-                                       "qs"=>0.5,
+                                       "qs"=>0.6,
                                        "charset"=>$client_charset,
                                        "lang"=>$lang,
                                        ),
                        negotiate_variant(
                                        "id"=>"application/xhtml+xml",
                                        "content-type"=>"application/xhtml+xml",
-                                       "qs"=>0.9,
+                                       "qs"=>0.6,
                                        "charset"=>$client_charset,
                                        "lang"=>$lang,
                                        ),