W3C home > Mailing lists > Public > ietf-http-wg@w3.org > April to June 2013

Re: p2: section 5.3.2 (Accept header)

From: Mark Nottingham <mnot@mnot.net>
Date: Thu, 9 May 2013 15:24:09 +1000
Cc: "ietf-http-wg@w3.org Group" <ietf-http-wg@w3.org>
Message-Id: <38634FA9-E0A3-439B-98E8-E3D0C32C32DB@mnot.net>
To: Osama Mazahir <OSAMAM@microsoft.com>
Hi Osama,

On 09/05/2013, at 10:36 AM, Osama Mazahir <OSAMAM@microsoft.com> wrote:

> In section 5.3.1, the weight is defined as:
> ------------
>      weight = OWS ";" OWS "q=" qvalue
>      qvalue = ( "0" [ "." 0*3DIGIT ] )
>             / ( "1" [ "." 0*3("0") ] )
> ------------
>  
> In section 5.3.2, the Accept header grammar is defined as:
> ------------
>      Accept = #( media-range [ accept-params ] )
>  
>      media-range    = ( "*/*"
>                       / ( type "/" "*" )
>                       / ( type "/" subtype )
>                       ) *( OWS ";" OWS parameter )
>      accept-params  = weight *( accept-ext )
>      accept-ext     = OWS ";" OWS token [ "=" word ]
> ------------
>  
> The grammar seems to imply that the weight is always the first parameter.  But then the example shows that the weight is not the first parameter (e.g. the level=2 case):
> ------------
>      Accept: text/*;q=0.3, text/html;q=0.7, text/html;level=1,
>              text/html;level=2;q=0.4, */*;q=0.5
> ------------
>  
> Which way is correct?

Note that the media-range grammar allows a parameter, separately from accept-params. This is because:

> The media-range can include media type parameters that are applicable to that range.
> 
> Each media-range might be followed by zero or more applicable media type parameters (e.g., charset), an optional "q" parameter for indicating a relative weight (Section 5.3.1), and then zero or more extension parameters. The "q" parameter is necessary if any extensions (accept-ext) are present, since it acts as a separator between the two parameter sets.

<https://svn.tools.ietf.org/svn/wg/httpbis/draft-ietf-httpbis/latest/p2-semantics.html#header.accept>

I.e., there's a difference parameters on the media-range itself (usually, defined by the media type itself) and the extensions to the Accept header value.

Cheers,

--
Mark Nottingham   http://www.mnot.net/
Received on Thursday, 9 May 2013 05:24:36 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 11:11:13 UTC