Re: #428 Accept-Language ordering for identical qvalues

"Roy T. Fielding" <> Thu, 17 January 2013 10:19 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 90EAC21F8880 for <>; Thu, 17 Jan 2013 02:19:08 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -10.599
X-Spam-Status: No, score=-10.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 70yEK6eB7D8l for <>; Thu, 17 Jan 2013 02:19:07 -0800 (PST)
Received: from ( []) by (Postfix) with ESMTP id 5833421F886D for <>; Thu, 17 Jan 2013 02:19:07 -0800 (PST)
Received: from lists by with local (Exim 4.72) (envelope-from <>) id 1TvmXT-0001oc-Tp for; Thu, 17 Jan 2013 10:17:39 +0000
Resent-Date: Thu, 17 Jan 2013 10:17:39 +0000
Resent-Message-Id: <>
Received: from ([]) by with esmtp (Exim 4.72) (envelope-from <>) id 1TvmXO-0001nx-Ew for; Thu, 17 Jan 2013 10:17:34 +0000
Received: from ([] by with esmtp (Exim 4.72) (envelope-from <>) id 1TvmXJ-0001Aj-EQ for; Thu, 17 Jan 2013 10:17:34 +0000
Received: from (localhost []) by (Postfix) with ESMTP id 8D8E1768059; Thu, 17 Jan 2013 02:17:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed;; h=subject :mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to;; bh=EDj0SpRAp+c4O8jU6f1zfUEbiM0=; b=sXlai5cleDgwROS8uZTB8SWJz0to jH1VgX8U1KbWqOV2QMP5vX/8ojAb9RHeUkPKT68IW5uKSwzEp0+doWQzSgMD7iW7 VM0V3rz94WP0ljiFBt5LbiWVhY0jmspfwGBKbK51vaN/HqyRtmYzlTbu+0H5i9/U IpYxuHvV26NdfzY=
Received: from [] ( []) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: by (Postfix) with ESMTPSA id 6C35D768057; Thu, 17 Jan 2013 02:17:08 -0800 (PST)
Mime-Version: 1.0 (Apple Message framework v1283)
Content-Type: text/plain; charset=us-ascii
From: "Roy T. Fielding" <>
In-Reply-To: <>
Date: Thu, 17 Jan 2013 02:17:06 -0800
Cc: HTTP Working Group <>
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <> <> <>
To: Julian Reschke <>
X-Mailer: Apple Mail (2.1283)
Received-SPF: none client-ip=;;
X-W3C-Hub-Spam-Status: No, score=-3.5
X-W3C-Hub-Spam-Report: AWL=-3.376, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001
X-W3C-Scan-Sig: 1TvmXJ-0001Aj-EQ d84a33fef3315411088df76f54eab993
Subject: Re: #428 Accept-Language ordering for identical qvalues
Archived-At: <>
X-Mailing-List: <> archive/latest/15956
Precedence: list
List-Id: <>
List-Help: <>
List-Post: <>
List-Unsubscribe: <>

On Jan 17, 2013, at 1:14 AM, Julian Reschke wrote:

> On 2013-01-17 09:59, Roy T. Fielding wrote:
>> The change is to improve interoperability when the preferences sent
>> result in a tie or contain no qvalues.
>> Firefox and Chrome have an ordered language UI that takes whatever
>> list the user comes up with and creates q-values to associate with
>> each language tag after the first.  The languages are always listed
>> in order of preference.  I've heard that Opera and MSIE do the same
> But they have different qvalues, so these UAs do *not* rely on ordering.

They order them *and* they send qvalues, because of broken sites like

and the change I made has no effect on UAs that send qvalues.
It does, however, improve the lot for users of other user agents
that either do not send qvalues or allow the user to specify the
value by hand, either of which can result in same-valued tags.

>> but haven't tested.  Chrome has a bug with the ordering of tags to
>> match the UI, but that's orthogonal to this issue.
>> ...
>> Older browsers did not send qvalues. Hence, server implementations
>> of language negotiation do use the ordering provided as I described
>> in the change.
> Some, apparently. But not all. Servers have been written according to the spec, ignoring ordering. If we make ordering significant, these will not interoperate anymore.

In what way do they interoperate now, and in what way does that
change?  As far as I can tell, the only effect this change has
is a suggestion that they not respond randomly.

>>> I believe this change should be backed out.
>> The change has no impact on user agents that send distinct
>> qvalues.  At most, it would change the interpretation for those
>> few requests that still rely on ordered language tags, for which
>> the prior specs had no interpretation at all.
> Well, it had an interpretation ("same weight").
> It's good that there are only few requests on relying on this. Do you want to encourage more, potentially breaking servers that ignore ordering?

It isn't possible to break those servers any more than they
are already broken by responding in a random fashion.

> Yes, I'm aware that this is a FAQ. But we're not starting from scratch here.
>> What I added is how Apache httpd has implemented it since before
>> any of the HTTP specs were RFCs, which was compatible with how
>> CERN httpd implemented it before that (no qvalues at all).
>> The change has no impact on conformance because language
>> negotiation is optional and the change is not expressed as a
>> requirement.  It also resolves an inconsistency with RFC4647.
> It does have an impact, because servers that previously implemented the optional feature now do not anymore.

A server is not required to obey Accept-Language.

>> There are far more examples on the Web where applications
>> incorrectly assume the list is ordered
> That'll be hard to count. :-)
>> than there are servers that implement language negotiation and
>> actually want to resolve ties at random.
> They do not "want" to resolve at random; they do so because they have implemented what the spec says. There's no reason to create an ordered list structure when the spec says that an unordered list is sufficient.

Yes, which is why we are changing the spec so that they can eventually
improve their implementation (or not).  An unordered list is not
sufficient because users don't send unordered lists, not even when
they are hand-crafted.  Everyone assumes they are ordered or they
send them with correct qvalues.

>> As Harald said,
>>> it seems still to be fairly normal to give a sequence of
>>> language-ranges in this header without any q= values, and expect the
>>> result to be deterministic.
> I'd like so see evidence of that, not hearsay. Browsers do *not* rely on this.


>> because that's how it works in practice for the vast majority
>> of systems that implement content negotiation.  The spec should
>> reflect what is most interoperable for the users.
> As far as I can tell, what's interoperable is the exact opposite: not relying on ordering, but sending qvalues.

One has nothing to do with the other.  The added text does not
change the ordering for UAs that send proper, non-identical
qvalues on language tags, even if they choose not to sort them
by order (which the latest browsers do for a good reason).