[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#157734: marked as done (request to support a wee bit of guesswork in content negotiation)



Your message dated Mon, 29 Sep 2014 22:56:13 +0200
with message-id <1939381.NcvIMBtSle@k>
and subject line Re: Bug#157734: workaround for wrong Accept-Language headers
has caused the Debian Bug report #157734,
regarding request to support a wee bit of guesswork in content negotiation
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
157734: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=157734
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: apache
Severity: wishlist
Version: 1.3.*

Hi,

When a user requests en-us, en-gb, en-au, en-ca or some other variant of en,
and Apache can't find a file in that variant of English, it doesn't try
simply en, but continues parsing the Accept-Language list.

For example:

% wget -q http://www.debian.org/ --header="Accept-Language: en-ca, fr" -O - | grep Language
<meta name="Language" content="French">

Despite the fact that:

% wget -q http://www.debian.org/ --header="Accept-Language: en, fr" -O - | grep Language
<meta name="Language" content="English">

In case the fallback (default) language of the server isn't up to the user's
liking, they will get an unknown language, and most of them won't realize
that their language preferences in the browser are at fault, that is, that
"English (<something>)" is not equal to "English (<any>)".

For the use in the Debian web pages (and 18 mirrors, a lot of which have
various default languages set up), we would really be grateful if a new
option could be added to Apache to make the daemon try the generic form of
the language first. Being able to restrict this behaviour to e.g. en-* would
be useful, too.

TIA.

-- 
     2. That which causes joy or happiness.


--- End Message ---
--- Begin Message ---
Version: 2.4.1-1

On Sunday 20 December 2009 01:52:44, Stefan Fritsch wrote:
> > We want the first user priority to be honored, even if we can't
> > satisfy it in a specific manner.
> 
> A partial workaround is possible with this mod_headers command:
> 
> RequestHeader edit Accept-Language
> "(^\s*|,\s*)(\w\w)-(\w\w)([^,]*)(,|$)"  "$1$2-$3$4, $2$4$5" early
> 
> This adds the corresponding generic language after the first
> non-generic  language, e.g "en-us" will become "en-us, en", or
> "en-us; q=0.4" will become "en-us; q=0.4, en; q=0.4".
> 
> This is only a partial workaround since it will only do what you
> want if  the languages are sorted with highest preference first
> (which need not be the case). I don't know how many browsers do
> this, but maybe you want to try it? At least for iceweasel it seems
> to work.
> 
> A complete fix would be possible with some global-edit command
> (which does  not exist yet).

There is now a global variant of edit, named "edit*". This should 
allow to configure the requested behavior.

--- End Message ---

Reply to: