Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 12277 invoked by uid 6000); 26 May 1998 15:53:36 -0000 Received: (qmail 12266 invoked from network); 26 May 1998 15:53:33 -0000 Received: from thoth.mch.sni.de (192.35.17.2) by taz.hyperreal.org with SMTP; 26 May 1998 15:53:33 -0000 X-Envelope-Sender-Is: Martin.Kraemer@mch.sni.de (at relayer thoth.mch.sni.de) Received: from deejai.mch.sni.de (deejai.mch.sni.de [139.25.105.242]) by thoth.mch.sni.de (8.8.8/8.8.8) with ESMTP id RAA00262 for ; Tue, 26 May 1998 17:53:27 +0200 (MDT) Received: (from martin@localhost) by deejai.mch.sni.de (8.8.7/8.8.7) id RAA07515; Tue, 26 May 1998 17:53:22 +0200 (MET DST) Message-ID: <19980526175316.55540@deejai.mch.sni.de> Date: Tue, 26 May 1998 17:53:16 +0200 From: Martin Kraemer To: new-httpd@apache.org Subject: Negotiation - can someone explain? Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.85 X-Disclaimer: THE COMMENTS CONTAINED IN THIS MESSAGE REFLECT THE VIEWS OF THE WRITER AND ARE NOT NECESSARILY THE VIEWS OF SIEMENS NIXDORF AG X-No-Junk-Mail: I do not want to get *any* junk mail. Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org The language negotiation algorithm seems to be somewhat unpredictable. Combined with DirectoryIndex and language definitions like "en-US" or "de-CH" they even look broken to me. In a directory containing these files... lrwxrwxrwx 1 martin 14 May 26 16:38 index.html.shtml -> index.shtml.en -rw-r--r-- 1 martin 339 May 7 13:11 index.shtml.de -rw-r--r-- 1 martin 735 May 7 13:11 index.shtml.de-BY -rw-r--r-- 1 martin 735 May 7 13:09 index.shtml.de-By -rw-r--r-- 1 martin 339 May 7 13:11 index.shtml.en -rw-r--r-- 1 martin 295 May 7 13:11 index.shtml.fr this script.... ---snip--- #!/bin/sh head /etc/httpd.conf n=0 for lang in th de en fr de-By "th, de-ch" "en;q=0.1, de-by;q=0.2" "en;q=0.6, de-by;q=0.2, de;q=0.5" "en-US;q=0.6, de-by;q=0.2, de;q=0.5" "en-US;q=0.1, de-by;q=0.2, de;q=0.5" do for URL in /~martin/neg/ /~martin/neg/index do n=`expr 1 + $n` echo "($n)=== Lang=$lang URL=$URL ===" netcat localhost 80 <<-. | tr -d '\015' | HEAD $URL HTTP/1.0 Accept-Language: $lang Host: localhost . ( read proto status message if [ _$status = _200 ]; then grep -i language else echo "$status $message" fi cat echo "" ) done done ---snip--- ...produces this output: AllowOverride AuthConfig FileInfo Indexes Limit Options +MultiViews -Indexes +FollowSymLinks +SymLinksIfOwnerMatch +ExecCGI DirectoryIndex index order deny,allow allow from all (1)=== Lang=th URL=/~martin/neg/ === (2)=== Lang=th URL=/~martin/neg/index === Vary: accept-language (3)=== Lang=de URL=/~martin/neg/ === Vary: accept-language Content-Language: de (4)=== Lang=de URL=/~martin/neg/index === Vary: accept-language Content-Language: de (5)=== Lang=en URL=/~martin/neg/ === Vary: accept-language Content-Language: en (6)=== Lang=en URL=/~martin/neg/index === Vary: accept-language Content-Language: en (7)=== Lang=fr URL=/~martin/neg/ === Vary: accept-language Content-Language: fr (8)=== Lang=fr URL=/~martin/neg/index === Vary: accept-language Content-Language: fr (9)=== Lang=de-By URL=/~martin/neg/ === Vary: accept-language Content-Language: de-by (10)=== Lang=de-By URL=/~martin/neg/index === Vary: accept-language Content-Language: de-by (11)=== Lang=th, de-ch URL=/~martin/neg/ === Vary: accept-language Content-Language: de (12)=== Lang=th, de-ch URL=/~martin/neg/index === Vary: accept-language (13)=== Lang=en;q=0.1, de-by;q=0.2 URL=/~martin/neg/ === Vary: accept-language Content-Language: de-by (14)=== Lang=en;q=0.1, de-by;q=0.2 URL=/~martin/neg/index === Vary: accept-language Content-Language: de-by (15)=== Lang=en;q=0.6, de-by;q=0.2, de;q=0.5 URL=/~martin/neg/ === Vary: accept-language Content-Language: en (16)=== Lang=en;q=0.6, de-by;q=0.2, de;q=0.5 URL=/~martin/neg/index === Vary: accept-language Content-Language: en (17)=== Lang=en-US;q=0.6, de-by;q=0.2, de;q=0.5 URL=/~martin/neg/ === Vary: accept-language Content-Language: de (18)=== Lang=en-US;q=0.6, de-by;q=0.2, de;q=0.5 URL=/~martin/neg/index === Vary: accept-language Content-Language: de (19)=== Lang=en-US;q=0.1, de-by;q=0.2, de;q=0.5 URL=/~martin/neg/ === Vary: accept-language Content-Language: de (20)=== Lang=en-US;q=0.1, de-by;q=0.2, de;q=0.5 URL=/~martin/neg/index === Vary: accept-language Content-Language: de - - - - - - Now my questions: In (1), - why does a request for neg/ (with a "DirectoryIndex index") give different results from a request for neg/index ? - Why is there no "Vary: accept-language" header for the "index.html.shtml" file? In (12), - why is there no "Content-Language: de" header, or better: - why was the "index.html.shtml" file chosen in preferance over "index.shtml.de"? In (17) and (18), - why was the english variant not chosen? It still had a better quality than the german variant. When I rename the index.html.shtml to index.shtml.shtml, then the same test gives a different output: --- x1 Tue May 26 17:11:32 1998 +++ x2 Tue May 26 17:12:49 1998 @@ -7,13 +7,14 @@ allow from all -lrwxrwxrwx 1 martin dbx 14 May 26 16:38 index.html.shtml -> index.shtml.en -rw-r--r-- 1 martin dbx 339 May 7 13:11 index.shtml.de -rw-r--r-- 1 martin dbx 735 May 7 13:11 index.shtml.de-BY -rw-r--r-- 1 martin dbx 735 May 7 13:09 index.shtml.de-By -rw-r--r-- 1 martin dbx 339 May 7 13:11 index.shtml.en -rw-r--r-- 1 martin dbx 295 May 7 13:11 index.shtml.fr +lrwxrwxrwx 1 martin dbx 14 May 26 16:38 index.shtml.shtml -> index.shtml.en (1)=== Lang=th URL=/~martin/neg/ === +Vary: accept-language (2)=== Lang=th URL=/~martin/neg/index === Vary: accept-language @@ -56,6 +57,7 @@ (12)=== Lang=th, de-ch URL=/~martin/neg/index === Vary: accept-language +Content-Language: de (13)=== Lang=en;q=0.1, de-by;q=0.2 URL=/~martin/neg/ === Vary: accept-language So, in (1) and (12), - why does index.html.shtml give different output for a .../ request and a .../index request, while with index.shtml.shtml the two are identical? Hmmm... Puzzled, Martin -- | S I E M E N S | | Siemens Nixdorf | ------------- | Voice: +49-89-636-46021 | Informationssysteme AG | N I X D O R F | FAX: +49-89-636-44994 | 81730 Munich, Germany ~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request