> wrowe 01/12/29 20:14:20
>
> Modified: modules/mappers mod_negotiation.c
> Log:
> Introduce the ForceLanguagePriority options;
>
> Prefer will circumvent a Multiple Choices by electing the first matching
> language from the LanaguagePriority list.
>
> Fallback will circumvent a None Acceptable by electing the first
> language found from the LanaguagePriority list.
>
> This breaks [expectedly] the negotiation tests. They need review.
> My test results will be posted to dev.
Notice; this patch breaks an earlier [backwards-broken] behavior, which could
be reintroduced if folks care. We once served the first listed accept-language
when no quality values were present. The essential question is; do we trust the
user to list them in order, or do we trust the administrators' list of languages
as authoritative?
Another side issue that I notice; we should _REALLY_ be presenting MULTIPLE
CHOICES rather than serving the smallest file. The smallest file -hack- is
exactly that, someone worthless for reasons debated on this list many times.
It's better for the site maintainer to observe that one of two files could
be served, and do something about it (a better naming convention, or whatever!)
Do I hear any agreement?
Finally, the promised test is attached. Notice that by default, the french
document is smaller than the english, so it wins [again, should have been an MC.]
[The choice of Arabic as my not-found case is in no way a slight! We simply don't
have a translation of the manual in arabic {yet}, and it's a code I can remember.]
The test was constructed with a very simple config;
Alias /priority/none "c:/Apache2/manual"
<Location /priority/none>
ForceLanguagePriority None
</Location>
Alias /priority/pre "c:/Apache2/manual"
<Location /priority/pre>
ForceLanguagePriority Prefer
</Location>
Alias /priority/fall "c:/Apache2/manual"
<Location /priority/fall>
ForceLanguagePriority Fallback
</Location>
Alias /priority/prefall "c:/Apache2/manual"
<Location /priority/prefall>
ForceLanguagePriority Prefer Fallback
</Location>
The obvious next change is to the /errors config, I'm changing that now.
The ultimate resolution would be internal server Q values for languages, content
types, and other variables. I'm not up to that in the next few months, if anyone
else thinks that sounds like an interesting project (for themselves to hack), feel
free to discuss.
Bill
HEAD /priority/none/ HTTP/1.1
Host: localhost
Accept-Language: ar
HTTP/1.1 406 Not Acceptable
Date: Sun, 30 Dec 2001 03:47:57 GMT
Server: Apache/2.0.30-dev (Win32) DAV/2 mod_ssl/3.0a0 OpenSSL/0.9.6b
mod_perl/1.99_01-dev Perl/v5.6.1
Alternates: {"index.html.en" 1 {type text/html} {language en} {length 9647}},
{"index.html.fr" 1 {type text/html} {language fr} {length 8490}}, {"index.html.ja.jis"
1 {type text/html} {charset iso-2022-jp} {language ja} {length 5793}}
Vary: negotiate,accept-language,accept-charset
TCN: list
Content-Type: text/html; charset=iso-8859-1
HEAD /priority/none/ HTTP/1.1
Host: localhost
Accept-Language: en,fr
HTTP/1.1 200 OK
Date: Sun, 30 Dec 2001 03:47:57 GMT
Server: Apache/2.0.30-dev (Win32) DAV/2 mod_ssl/3.0a0 OpenSSL/0.9.6b
mod_perl/1.99_01-dev Perl/v5.6.1
Content-Location: index.html.fr
Vary: negotiate,accept-language,accept-charset
TCN: choice
Last-Modified: Mon, 24 Sep 2001 21:48:26 GMT
ETag: "0-212a-2e3f5e80"
Accept-Ranges: bytes
Content-Length: 8490
Content-Type: text/html; charset=ISO-8859-1
Content-Language: fr
HEAD /priority/none/ HTTP/1.1
Host: localhost
Accept-Language: en;q=.3,fr;q=.7
HTTP/1.1 200 OK
Date: Sun, 30 Dec 2001 03:47:57 GMT
Server: Apache/2.0.30-dev (Win32) DAV/2 mod_ssl/3.0a0 OpenSSL/0.9.6b
mod_perl/1.99_01-dev Perl/v5.6.1
Content-Location: index.html.fr
Vary: negotiate,accept-language,accept-charset
TCN: choice
Last-Modified: Mon, 24 Sep 2001 21:48:26 GMT
ETag: "0-212a-2e3f5e80"
Accept-Ranges: bytes
Content-Length: 8490
Content-Type: text/html; charset=ISO-8859-1
Content-Language: fr
HEAD /priority/none/ HTTP/1.1
Host: localhost
Accept-Language: en;q=.7,fr;q=.3
HTTP/1.1 200 OK
Date: Sun, 30 Dec 2001 03:47:57 GMT
Server: Apache/2.0.30-dev (Win32) DAV/2 mod_ssl/3.0a0 OpenSSL/0.9.6b
mod_perl/1.99_01-dev Perl/v5.6.1
Content-Location: index.html.en
Vary: negotiate,accept-language,accept-charset
TCN: choice
Last-Modified: Mon, 03 Dec 2001 19:50:48 GMT
ETag: "0-25af-b2731600"
Accept-Ranges: bytes
Content-Length: 9647
Content-Type: text/html; charset=ISO-8859-1
Content-Language: en
HEAD /priority/pre/ HTTP/1.1
Host: localhost
Accept-Language: ar
HTTP/1.1 406 Not Acceptable
Date: Sun, 30 Dec 2001 03:47:57 GMT
Server: Apache/2.0.30-dev (Win32) DAV/2 mod_ssl/3.0a0 OpenSSL/0.9.6b
mod_perl/1.99_01-dev Perl/v5.6.1
Alternates: {"index.html.en" 1 {type text/html} {language en} {length 9647}},
{"index.html.fr" 1 {type text/html} {language fr} {length 8490}}, {"index.html.ja.jis"
1 {type text/html} {charset iso-2022-jp} {language ja} {length 5793}}
Vary: negotiate,accept-language,accept-charset
TCN: list
Content-Type: text/html; charset=iso-8859-1
HEAD /priority/pre/ HTTP/1.1
Host: localhost
Accept-Language: en,fr
HTTP/1.1 200 OK
Date: Sun, 30 Dec 2001 03:47:57 GMT
Server: Apache/2.0.30-dev (Win32) DAV/2 mod_ssl/3.0a0 OpenSSL/0.9.6b
mod_perl/1.99_01-dev Perl/v5.6.1
Content-Location: index.html.en
Vary: negotiate,accept-language,accept-charset
TCN: choice
Last-Modified: Mon, 03 Dec 2001 19:50:48 GMT
ETag: "0-25af-b2731600"
Accept-Ranges: bytes
Content-Length: 9647
Content-Type: text/html; charset=ISO-8859-1
Content-Language: en
HEAD /priority/pre/ HTTP/1.1
Host: localhost
Accept-Language: en;q=.3,fr;q=.7
HTTP/1.1 200 OK
Date: Sun, 30 Dec 2001 03:47:57 GMT
Server: Apache/2.0.30-dev (Win32) DAV/2 mod_ssl/3.0a0 OpenSSL/0.9.6b
mod_perl/1.99_01-dev Perl/v5.6.1
Content-Location: index.html.fr
Vary: negotiate,accept-language,accept-charset
TCN: choice
Last-Modified: Mon, 24 Sep 2001 21:48:26 GMT
ETag: "0-212a-2e3f5e80"
Accept-Ranges: bytes
Content-Length: 8490
Content-Type: text/html; charset=ISO-8859-1
Content-Language: fr
HEAD /priority/pre/ HTTP/1.1
Host: localhost
Accept-Language: en;q=.7,fr;q=.3
HTTP/1.1 200 OK
Date: Sun, 30 Dec 2001 03:47:57 GMT
Server: Apache/2.0.30-dev (Win32) DAV/2 mod_ssl/3.0a0 OpenSSL/0.9.6b
mod_perl/1.99_01-dev Perl/v5.6.1
Content-Location: index.html.en
Vary: negotiate,accept-language,accept-charset
TCN: choice
Last-Modified: Mon, 03 Dec 2001 19:50:48 GMT
ETag: "0-25af-b2731600"
Accept-Ranges: bytes
Content-Length: 9647
Content-Type: text/html; charset=ISO-8859-1
Content-Language: en
HEAD /priority/fall/ HTTP/1.1
Host: localhost
Accept-Language: ar
HTTP/1.1 200 OK
Date: Sun, 30 Dec 2001 03:47:57 GMT
Server: Apache/2.0.30-dev (Win32) DAV/2 mod_ssl/3.0a0 OpenSSL/0.9.6b
mod_perl/1.99_01-dev Perl/v5.6.1
Content-Location: index.html.en
Vary: negotiate,accept-language,accept-charset
TCN: choice
Last-Modified: Mon, 03 Dec 2001 19:50:48 GMT
ETag: "0-25af-b2731600"
Accept-Ranges: bytes
Content-Length: 9647
Content-Type: text/html; charset=ISO-8859-1
Content-Language: en
HEAD /priority/fall/ HTTP/1.1
Host: localhost
Accept-Language: en,fr
HTTP/1.1 200 OK
Date: Sun, 30 Dec 2001 03:47:57 GMT
Server: Apache/2.0.30-dev (Win32) DAV/2 mod_ssl/3.0a0 OpenSSL/0.9.6b
mod_perl/1.99_01-dev Perl/v5.6.1
Content-Location: index.html.fr
Vary: negotiate,accept-language,accept-charset
TCN: choice
Last-Modified: Mon, 24 Sep 2001 21:48:26 GMT
ETag: "0-212a-2e3f5e80"
Accept-Ranges: bytes
Content-Length: 8490
Content-Type: text/html; charset=ISO-8859-1
Content-Language: fr
HEAD /priority/fall/ HTTP/1.1
Host: localhost
Accept-Language: en;q=.3,fr;q=.7
HTTP/1.1 200 OK
Date: Sun, 30 Dec 2001 03:47:57 GMT
Server: Apache/2.0.30-dev (Win32) DAV/2 mod_ssl/3.0a0 OpenSSL/0.9.6b
mod_perl/1.99_01-dev Perl/v5.6.1
Content-Location: index.html.fr
Vary: negotiate,accept-language,accept-charset
TCN: choice
Last-Modified: Mon, 24 Sep 2001 21:48:26 GMT
ETag: "0-212a-2e3f5e80"
Accept-Ranges: bytes
Content-Length: 8490
Content-Type: text/html; charset=ISO-8859-1
Content-Language: fr
HEAD /priority/fall/ HTTP/1.1
Host: localhost
Accept-Language: en;q=.7,fr;q=.3
HTTP/1.1 200 OK
Date: Sun, 30 Dec 2001 03:47:57 GMT
Server: Apache/2.0.30-dev (Win32) DAV/2 mod_ssl/3.0a0 OpenSSL/0.9.6b
mod_perl/1.99_01-dev Perl/v5.6.1
Content-Location: index.html.en
Vary: negotiate,accept-language,accept-charset
TCN: choice
Last-Modified: Mon, 03 Dec 2001 19:50:48 GMT
ETag: "0-25af-b2731600"
Accept-Ranges: bytes
Content-Length: 9647
Content-Type: text/html; charset=ISO-8859-1
Content-Language: en
HEAD /priority/prefall/ HTTP/1.1
Host: localhost
Accept-Language: ar
HTTP/1.1 200 OK
Date: Sun, 30 Dec 2001 03:47:57 GMT
Server: Apache/2.0.30-dev (Win32) DAV/2 mod_ssl/3.0a0 OpenSSL/0.9.6b
mod_perl/1.99_01-dev Perl/v5.6.1
Content-Location: index.html.en
Vary: negotiate,accept-language,accept-charset
TCN: choice
Last-Modified: Mon, 03 Dec 2001 19:50:48 GMT
ETag: "0-25af-b2731600"
Accept-Ranges: bytes
Content-Length: 9647
Content-Type: text/html; charset=ISO-8859-1
Content-Language: en
HEAD /priority/prefall/ HTTP/1.1
Host: localhost
Accept-Language: en,fr
HTTP/1.1 200 OK
Date: Sun, 30 Dec 2001 03:47:57 GMT
Server: Apache/2.0.30-dev (Win32) DAV/2 mod_ssl/3.0a0 OpenSSL/0.9.6b
mod_perl/1.99_01-dev Perl/v5.6.1
Content-Location: index.html.en
Vary: negotiate,accept-language,accept-charset
TCN: choice
Last-Modified: Mon, 03 Dec 2001 19:50:48 GMT
ETag: "0-25af-b2731600"
Accept-Ranges: bytes
Content-Length: 9647
Content-Type: text/html; charset=ISO-8859-1
Content-Language: en
HEAD /priority/prefall/ HTTP/1.1
Host: localhost
Accept-Language: en;q=.3,fr;q=.7
HTTP/1.1 200 OK
Date: Sun, 30 Dec 2001 03:47:57 GMT
Server: Apache/2.0.30-dev (Win32) DAV/2 mod_ssl/3.0a0 OpenSSL/0.9.6b
mod_perl/1.99_01-dev Perl/v5.6.1
Content-Location: index.html.fr
Vary: negotiate,accept-language,accept-charset
TCN: choice
Last-Modified: Mon, 24 Sep 2001 21:48:26 GMT
ETag: "0-212a-2e3f5e80"
Accept-Ranges: bytes
Content-Length: 8490
Content-Type: text/html; charset=ISO-8859-1
Content-Language: fr
HEAD /priority/prefall/ HTTP/1.1
Host: localhost
Accept-Language: en;q=.7,fr;q=.3
Connection: close
HTTP/1.1 200 OK
Date: Sun, 30 Dec 2001 03:47:57 GMT
Server: Apache/2.0.30-dev (Win32) DAV/2 mod_ssl/3.0a0 OpenSSL/0.9.6b
mod_perl/1.99_01-dev Perl/v5.6.1
Content-Location: index.html.en
Vary: negotiate,accept-language,accept-charset
TCN: choice
Last-Modified: Mon, 03 Dec 2001 19:50:48 GMT
ETag: "0-25af-b2731600"
Accept-Ranges: bytes
Content-Length: 9647
Connection: close
Content-Type: text/html; charset=ISO-8859-1
Content-Language: en