W3C home > Mailing lists > Public > ietf-http-wg@w3.org > October to December 2016

Re: Is “fr, en; q=0.3” a valid Accept-Language value?

From: Julian Reschke <julian.reschke@gmx.de>
Date: Wed, 19 Oct 2016 08:32:12 +0200
To: Samuel Williams <space.ship.traveller@gmail.com>, ietf-http-wg@w3.org
Message-ID: <7135c8b0-9f02-04bb-5649-dbab1ba6313c@gmx.de>
On 2016-10-19 02:31, Samuel Williams wrote:
> According to the RFC, it's okay to have *LWS between words and
> separators. However, if you look at the specific ABNF for matching the
> Accept-Language field, it doesn't allow for whitespace around the ;
> character.
>
> Here is the exact LWS specification:
>
> implied *LWS: The grammar described by this specification is
> word-based. Except where noted otherwise, linear white space (LWS) can
> be included between any two adjacent words (token or quoted-string),
> and between adjacent words and separators, without changing the
> interpretation of a field. At least one delimiter (LWS and/or
> separators) MUST exist between any two tokens (for the definition of
> "token" below), since they would otherwise be interpreted as a single
> token.
>
> Here is the ABNF grammar:
>
>    Accept-Language = "Accept-Language" ":"
>                      1#( language-range [ ";" "q" "=" qvalue ] )
>    language-range  = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )
>
> Any advice would be appreciated. Thanks

a) Look at the current spec, not RFC 2616.

b) Over there you will find:

>   weight = OWS ";" OWS "q=" qvalue
>   qvalue = ( "0" [ "." 0*3DIGIT ] )
>          / ( "1" [ "." 0*3("0") ] )


<https://greenbytes.de/tech/webdav/rfc7231.html#quality.values>

Best regards, Julian
Received on Wednesday, 19 October 2016 06:32:56 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 19 October 2016 06:32:59 UTC