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

Re: Range requests and content encoding

From: Roy T. Fielding <fielding@gbiv.com>
Date: Wed, 6 Jan 2016 13:45:08 -0800
Cc: Group HTTP Working <ietf-http-wg@w3.org>
Message-Id: <F030C6DE-CB97-43B7-A826-3248D5572D74@gbiv.com>
To: K.Morgan@iaea.org
> On Jan 5, 2016, at 3:02 AM, K.Morgan@iaea.org wrote:
> 
> On Tuesday,22 December 2015 03:29 martin.thomson@gmail.com <mailto:martin.thomson@gmail.com> wrote:
> > RFC 7233 does not mention content encoding at all.  Same for transfer
> > encoding.  I assume that is because this is completely unspecified and therefore
> > completely unreliable, however, for my sanity...
> > 
> > My reading is that a 206 response includes ranges of the encoded message, and
> > that the content-encoding applies to the complete message body prior to being
> > split into ranges.  
> > 
> > [snip]
> > 
> > On the other hand, I have to assume that a Transfer-Encoding applies
> > *after* the range request.
> > 
>  
> As others pointed out, your assumptions are correct on both accounts. This was _explicit_ in the old RFC2616 by tracing the following sequence of logic...
> - "The message-body (if any) of an HTTP message is used to carry the entity-body associated with the request or response. The message-body differs from the entity-body only when a transfer-coding has been applied" RFC2616 Section 4.3 [1]
> - "message-body = entity-body | <entity-body encoded as per Transfer-Encoding>" Section 4.3 [1]
> - "entity-body := Content-Encoding( Content-Type( data ) )" RFC2616 Section 7.2.1 [2]
> - "Byte range specifications in HTTP *apply to the sequence of bytes in the entity-body* ..." RFC2616 Section 14.35.1 [3] (emphasis added)
>  
> RFC 7230 provides a new definition of message-body and eliminates a definition for entity-body:
> - "message-body = *OCTET" RFC7230 Section 3.3 [4]
> - "Unlike Content-Encoding (Section 3.1.2.1 of [RFC7231]), Transfer-Encoding is a property of the message, not of the representation ..." RFC7230 Section 3.3.1 [5]
>  
> Since RFC7230 eliminated a definition for entity-body, RFC 7233 now only includes this vague (and IMO ambiguous) assertion that _might_ lead one to understand that ranges only apply to the content-encoded representation.
> - "A byte-range request can specify a single range of bytes or a set of ranges within a single representation." RFC7233 Section 2.1 [6]
>  
> IMO the ambiguity should be fixed.

The term entity-body is now referred to as either the payload body or the selected representation,
depending upon whether we are talking about an actual message.  Content-Encoding is defined in

https://tools.ietf.org/html/rfc7231#section-3.1.2.2 <https://tools.ietf.org/html/rfc7231#section-3.1.2.2>

and there is nothing ambiguous about it.  RFC7233 doesn't talk about it because it doesn't need to,
just like it doesn't need to talk about the other representation metadata (unlike the metadata that
impacts message framing, which it does talk about).

....Roy
Received on Wednesday, 6 January 2016 21:45:43 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 22 March 2016 12:47:10 UTC