source: draft-ietf-httpbis/latest/p5-range.xml @ 2135

Last change on this file since 2135 was 2135, checked in by fielding@…, 8 years ago

Cleanup on aisle p5. Addresses #405

Don't refer to Range Units as Range Specifiers;
move requirements on unknown ranges to the header field definitions.
Disentangle the Content-Range ABNF so that it correctly distinguishes between
the three different forms in use and does not allow them to be mixed.
Use the new ABNF alternatives to simplify the prose.

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/xml
File size: 59.7 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<?xml-stylesheet type='text/xsl' href='../myxml2rfc.xslt'?>
3<!DOCTYPE rfc [
4  <!ENTITY MAY "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MAY</bcp14>">
5  <!ENTITY MUST "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST</bcp14>">
6  <!ENTITY MUST-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST NOT</bcp14>">
7  <!ENTITY OPTIONAL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>OPTIONAL</bcp14>">
8  <!ENTITY RECOMMENDED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>RECOMMENDED</bcp14>">
9  <!ENTITY REQUIRED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>REQUIRED</bcp14>">
10  <!ENTITY SHALL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL</bcp14>">
11  <!ENTITY SHALL-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL NOT</bcp14>">
12  <!ENTITY SHOULD "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD</bcp14>">
13  <!ENTITY SHOULD-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD NOT</bcp14>">
14  <!ENTITY ID-VERSION "latest">
15  <!ENTITY ID-MONTH "January">
16  <!ENTITY ID-YEAR "2013">
17  <!ENTITY Note "<x:h xmlns:x='http://purl.org/net/xml2rfc/ext'>Note:</x:h>">
18  <!ENTITY architecture               "<xref target='Part1' x:rel='#architecture' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
19  <!ENTITY conformance                "<xref target='Part1' x:rel='#conformance' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
20  <!ENTITY notation                   "<xref target='Part1' x:rel='#notation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
21  <!ENTITY abnf-extension             "<xref target='Part1' x:rel='#abnf.extension' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
22  <!ENTITY acks                       "<xref target='Part1' x:rel='#acks' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
23  <!ENTITY whitespace                 "<xref target='Part1' x:rel='#whitespace' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
24  <!ENTITY field-components           "<xref target='Part1' x:rel='#field.components' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
25  <!ENTITY http-date                  "<xref target='Part2' x:rel='#http.date' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
26  <!ENTITY messaging                  "<xref target='Part1' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
27  <!ENTITY semantics                  "<xref target='Part2' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
28  <!ENTITY entity-tags                "<xref target='Part4' x:rel='#header.etag' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
29  <!ENTITY weak-and-strong-validators "<xref target='Part4' x:rel='#weak.and.strong.validators' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
30  <!ENTITY lastmod-comparison         "<xref target='Part4' x:rel='#lastmod.comparison' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
31  <!ENTITY p6-heuristic               "<xref target='Part6' x:rel='#heuristic.freshness' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
32]>
33<?rfc toc="yes" ?>
34<?rfc symrefs="yes" ?>
35<?rfc sortrefs="yes" ?>
36<?rfc compact="yes"?>
37<?rfc subcompact="no" ?>
38<?rfc linkmailto="no" ?>
39<?rfc editing="no" ?>
40<?rfc comments="yes"?>
41<?rfc inline="yes"?>
42<?rfc rfcedstyle="yes"?>
43<?rfc-ext allow-markup-in-artwork="yes" ?>
44<?rfc-ext include-references-in-index="yes" ?>
45<rfc obsoletes="2616" category="std" x:maturity-level="proposed"
46     ipr="pre5378Trust200902" docName="draft-ietf-httpbis-p5-range-&ID-VERSION;"
47     xmlns:x='http://purl.org/net/xml2rfc/ext'>
48<x:link rel="prev" basename="p4-conditional"/>
49<x:link rel="next" basename="p6-cache"/>
50<x:feedback template="mailto:ietf-http-wg@w3.org?subject={docname},%20%22{section}%22&amp;body=&lt;{ref}&gt;:"/>
51<front>
52
53  <title abbrev="HTTP/1.1 Range Requests">Hypertext Transfer Protocol (HTTP/1.1): Range Requests</title>
54
55  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
56    <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
57    <address>
58      <postal>
59        <street>345 Park Ave</street>
60        <city>San Jose</city>
61        <region>CA</region>
62        <code>95110</code>
63        <country>USA</country>
64      </postal>
65      <email>fielding@gbiv.com</email>
66      <uri>http://roy.gbiv.com/</uri>
67    </address>
68  </author>
69
70  <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
71    <organization abbrev="W3C">World Wide Web Consortium</organization>
72    <address>
73      <postal>
74        <street>W3C / ERCIM</street>
75        <street>2004, rte des Lucioles</street>
76        <city>Sophia-Antipolis</city>
77        <region>AM</region>
78        <code>06902</code>
79        <country>France</country>
80      </postal>
81      <email>ylafon@w3.org</email>
82      <uri>http://www.raubacapeu.net/people/yves/</uri>
83    </address>
84  </author>
85
86  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
87    <organization abbrev="greenbytes">greenbytes GmbH</organization>
88    <address>
89      <postal>
90        <street>Hafenweg 16</street>
91        <city>Muenster</city><region>NW</region><code>48155</code>
92        <country>Germany</country>
93      </postal>
94      <email>julian.reschke@greenbytes.de</email>
95      <uri>http://greenbytes.de/tech/webdav/</uri>
96    </address>
97  </author>
98
99  <date month="&ID-MONTH;" year="&ID-YEAR;"/>
100  <workgroup>HTTPbis Working Group</workgroup>
101
102<abstract>
103<t>
104   The Hypertext Transfer Protocol (HTTP) is an application-level protocol for
105   distributed, collaborative, hypertext information systems. This document
106   defines range requests and the rules for constructing and combining
107   responses to those requests.
108</t>
109</abstract>
110
111<note title="Editorial Note (To be removed by RFC Editor)">
112  <t>
113    Discussion of this draft takes place on the HTTPBIS working group
114    mailing list (ietf-http-wg@w3.org), which is archived at
115    <eref target="http://lists.w3.org/Archives/Public/ietf-http-wg/"/>.
116  </t>
117  <t>
118    The current issues list is at
119    <eref target="http://tools.ietf.org/wg/httpbis/trac/report/3"/> and related
120    documents (including fancy diffs) can be found at
121    <eref target="http://tools.ietf.org/wg/httpbis/"/>.
122  </t>
123  <t>
124    The changes in this draft are summarized in <xref target="changes.since.21"/>.
125  </t>
126</note>
127</front>
128<middle>
129<section title="Introduction" anchor="introduction">
130<t>
131   HTTP clients often encounter interrupted data transfers as a result
132   of canceled requests or dropped connections.  When a client has stored
133   a partial representation, it is desirable to request the remainder
134   of that representation in a subsequent request rather than transfer
135   the entire representation.
136   There are also a number of Web applications that benefit from being
137   able to request only a subset of a larger representation, such as a
138   single page of a very large document or only part of an image to be
139   rendered by a device with limited local storage.
140</t>
141<t>
142   This document defines HTTP/1.1 range requests,
143   partial responses, and the multipart/byteranges media type.
144   The protocol for range requests is an &OPTIONAL; feature of HTTP,
145   designed so resources or recipients that do not implement this feature
146   can respond as if it is a normal GET request without impacting
147   interoperability.  Partial responses are indicated by a distinct status
148   code to not be mistaken for full responses by intermediate caches
149   that might not implement the feature.
150</t>
151<t>
152   Although the HTTP range request mechanism is designed to allow for
153   extensible range types, this specification only defines requests for
154   byte ranges.
155</t>
156
157<section title="Conformance and Error Handling" anchor="conformance">
158<t>
159   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
160   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
161   document are to be interpreted as described in <xref target="RFC2119"/>.
162</t>
163<t>
164   Conformance criteria and considerations regarding error handling
165   are defined in &conformance;.
166</t>
167</section>
168
169<section title="Syntax Notation" anchor="notation">
170<t>
171   This specification uses the Augmented Backus-Naur Form (ABNF) notation
172   of <xref target="RFC5234"/> with the list rule extension defined in
173   &notation;. <xref target="imported.abnf"/> describes rules imported from
174   other documents. <xref target="collected.abnf"/> shows the collected ABNF
175   with the list rule expanded.
176</t>
177</section>
178
179</section>
180
181
182<section title="Range Units" anchor="range.units">
183  <x:anchor-alias value="bytes-unit"/>
184  <x:anchor-alias value="other-range-unit"/>
185  <x:anchor-alias value="range-unit"/>
186  <x:anchor-alias value="range unit"/>
187<t>
188   A representation can be partitioned into subranges according to various
189   structural units, depending on the structure inherent in the
190   representation's media type. Such a <x:dfn>range unit</x:dfn> can be used
191   in the <x:ref>Range</x:ref> (<xref target="header.range"/>) and
192   <x:ref>Content-Range</x:ref> (<xref target="header.content-range"/>)
193   header fields to delineate the parts of a representation that are
194   either requested or transferred, respectively.
195</t>
196<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="range-unit"/><iref primary="true" item="Grammar" subitem="bytes-unit"/><iref primary="true" item="Grammar" subitem="other-range-unit"/>
197  <x:ref>range-unit</x:ref>       = <x:ref>bytes-unit</x:ref> / <x:ref>other-range-unit</x:ref>
198  <x:ref>bytes-unit</x:ref>       = "bytes"
199  <x:ref>other-range-unit</x:ref> = <x:ref>token</x:ref>
200</artwork></figure>
201<t>
202  The only range unit defined by HTTP/1.1 is "bytes"
203  (<xref target="byte.ranges"/>). Additional units can be defined as described
204  in <xref target="range.unit.registry"/>.
205</t>
206
207<section title="Range Unit Registry" anchor="range.unit.registry">
208<t>
209   The HTTP Range Unit Registry defines the name space for the range
210   unit names and refers to their corresponding specifications.
211</t>
212<t>
213   Registrations &MUST; include the following fields:
214   <list style="symbols">
215     <t>Name</t>
216     <t>Description</t>
217     <t>Pointer to specification text</t>
218   </list>
219</t>
220<t>
221  Values to be added to this name space require IETF Review
222  (see <xref target="RFC5226" x:fmt="," x:sec="4.1"/>).
223</t>
224<t>
225   The registry itself is maintained at
226   <eref target="http://www.iana.org/assignments/http-range-specifiers"/>.
227</t>
228</section>
229
230</section>
231
232<section title="Status Code Definitions" anchor="status.code.definitions">
233<section title="206 Partial Content" anchor="status.206">
234  <iref primary="true" item="206 Partial Content (status code)" x:for-anchor=""/>
235  <x:anchor-alias value="206"/>
236  <x:anchor-alias value="206 (Partial Content)"/>
237<t>
238   The <x:dfn>206 (Partial Content)</x:dfn> status code indicates that the
239   server has fulfilled the partial GET request for the resource.
240   The request &MUST; have included a <x:ref>Range</x:ref> header field
241   (<xref target="header.range"/>) indicating the desired range, and &MAY; have
242   included an <x:ref>If-Range</x:ref> header field
243   (<xref target="header.if-range"/>) to make the request conditional.
244</t>
245<t>
246   When a 206 response is generated, the sender &MUST; generate the following
247   header fields:
248  <list style="symbols">
249    <t>
250        Either a <x:ref>Content-Range</x:ref> header field
251        (<xref target="header.content-range"/>) indicating
252        the range included with this response, or a multipart/byteranges
253        <x:ref>Content-Type</x:ref> including Content-Range fields for each
254        part. If a <x:ref>Content-Length</x:ref> header field is present in the
255        response, its value &MUST; match the actual number of octets
256        transmitted in the message body.
257    </t>
258    <t>
259        Date
260    </t>
261    <t>
262        <x:ref>Cache-Control</x:ref>, <x:ref>ETag</x:ref>,
263        <x:ref>Expires</x:ref>, <x:ref>Content-Location</x:ref> and/or
264        <x:ref>Vary</x:ref>, if the header field would have been sent in a
265        <x:ref>200 (OK)</x:ref> response to the same request
266    </t>
267  </list>
268</t>
269<t>
270   If a 206 is generated in response to a request with an <x:ref>If-Range</x:ref>
271   header field, the sender &SHOULD-NOT; generate other representation header
272   fields beyond those described above.
273   Otherwise, the sender &MUST; generate all of the same representation header
274   fields that would have been sent in a <x:ref>200 (OK)</x:ref> response
275   to the same request.
276</t>
277<t>
278   Caches &MAY; use a heuristic (see &p6-heuristic;) to determine
279   freshness for 206 responses.
280</t>
281</section>
282
283<section title="416 Range Not Satisfiable" anchor="status.416">
284  <iref primary="true" item="416 Range Not Satisfiable (status code)" x:for-anchor=""/>
285  <x:anchor-alias value="416 (Range Not Satisfiable)"/>
286<t>
287   The <x:dfn>416 (Range Not Satisfiable)</x:dfn> status code
288   indicates that none of the ranges-specifier values in the request's
289   <x:ref>Range</x:ref> header field (<xref target="header.range"/>)
290   overlap the current
291   extent of the selected resource and the request did not include an
292   <x:ref>If-Range</x:ref> header field (<xref target="header.if-range"/>).
293   (For byte-ranges, this means that the first-byte-pos of all of the
294   byte-range-spec values were greater than the current length of the selected
295   representation.)
296</t>
297<t>
298   When this status code is sent in response to a byte-range request, the
299   sender &SHOULD; generate a <x:ref>Content-Range</x:ref> header field
300   specifying the current length of the selected representation
301   (see <xref target="header.content-range"/>).
302</t>
303<figure>
304<preamble>For example:</preamble>
305<artwork type="message/http; msgtype=&#34;response&#34;" x:indent-with="  ">
306HTTP/1.1 416 Range Not Satisfiable
307Date: Mon, 20 Jan 2012 15:41:54 GMT
308Content-Range: bytes */47022
309Content-Type: image/gif
310</artwork></figure>
311<x:note>
312  <t>
313    &Note; Clients cannot depend on servers to send a <x:ref>416 (Range Not
314    Satisfiable)</x:ref> response instead of a <x:ref>200 (OK)</x:ref>
315    response for an unsatisfiable <x:ref>Range</x:ref> header field, since not
316    all servers implement this header field.
317  </t>
318</x:note>
319</section>
320</section>
321
322<section title="Responses to a Range Request" anchor="range.response">
323<section title="Response to a Single and Multiple Ranges Request">
324<t>
325   When an HTTP message includes the content of a single range (for
326   example, a response to a request for a single range, or to a request
327   for a set of ranges that overlap without any holes), this content is
328   transmitted with a <x:ref>Content-Range</x:ref> header field, and a
329   <x:ref>Content-Length</x:ref> header field showing the number of bytes
330   actually transferred. For example,
331</t>
332<figure><artwork type="message/http; msgtype=&#34;response&#34;" x:indent-with="  ">
333HTTP/1.1 206 Partial Content
334Date: Wed, 15 Nov 1995 06:25:24 GMT
335Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
336Content-Range: bytes 21010-47021/47022
337Content-Length: 26012
338Content-Type: image/gif
339</artwork></figure>
340<t>
341   When an HTTP message includes the content of multiple ranges (for
342   example, a response to a request for multiple non-overlapping
343   ranges), these are transmitted as a multipart message. The multipart
344   media type used for this purpose is "multipart/byteranges" as defined
345   in <xref target="internet.media.type.multipart.byteranges"/>.
346</t>
347<t>
348   A server &MAY; combine requested ranges when those ranges are overlapping
349   (see <xref target="overlapping.ranges"/>).
350</t>
351<t>
352   A response to a request for a single range &MUST-NOT; be sent using the
353   multipart/byteranges media type.  A response to a request for
354   multiple ranges, whose result is a single range, &MAY; be sent as a
355   multipart/byteranges media type with one part. A client that cannot
356   decode a multipart/byteranges message &MUST-NOT; ask for multiple
357   ranges in a single request.
358</t>
359<t>
360   When a client asks for multiple ranges in one request, the
361   server &SHOULD; send them in the order that they appeared in the
362   request.
363</t>
364</section>
365
366<section title="Combining Ranges" anchor="combining.byte.ranges">
367<t>
368   A response might transfer only a subrange of a representation if the
369   connection closed prematurely or if the request used one or more Range
370   specifications.  After several such transfers, a client might have
371   received several ranges of the same representation.  These ranges can only
372   be safely combined if they all have in common the same strong validator,
373   where "strong validator" is defined to be either an entity-tag that is
374   not marked as weak (&entity-tags;) or, if no entity-tag is provided, a
375   <x:ref>Last-Modified</x:ref> value that is strong in the sense defined by
376   &lastmod-comparison;.
377</t>
378<t>
379   When a client receives an incomplete <x:ref>200 (OK)</x:ref> response or a
380   <x:ref>206 (Partial Content)</x:ref> response, and already has one or more
381   partial responses for the same method and effective request URI that have
382   the same strong validator as present in the new response,
383   the recipient &MAY; combine some or all of those responses into a set of
384   continuous ranges. A client &MUST-NOT; combine responses that differ in the
385   strong validator or that do not have a strong validator.
386</t>
387<t>
388   If the new response is an incomplete <x:ref>200 (OK)</x:ref> response, then
389   the header fields of that new response are used for any combined response
390   and replace those of the matching stored responses.
391</t>
392<t>
393   If the new response is a <x:ref>206 (Partial Content)</x:ref> response and
394   at least one of the matching stored responses is a <x:ref>200 (OK)</x:ref>,
395   then the combined response header fields consist of the most recent 200
396   response's header fields. If all of the matching stored responses are 206
397   responses, then the stored response with the most recent header fields is
398   used as the source of header fields for the combined response, except that
399   the client &MUST; use other header fields provided in the new response,
400   aside from <x:ref>Content-Range</x:ref>, to replace all instances of the
401   corresponding header fields in the stored response.
402</t>
403<t>
404   The combined response message body consists of the union of partial
405   content ranges in the new response and each of the selected responses.
406   If the union consists of the entire range of the representation, then the
407   client &MUST; record the combined response as if it were a complete
408   <x:ref>200 (OK)</x:ref> response, including a <x:ref>Content-Length</x:ref>
409   header field that reflects the complete length.
410   Otherwise, the client &MUST; record the set of continuous ranges as one of
411   the following:
412   an incomplete <x:ref>200 (OK)</x:ref> response if the combined response is
413   a prefix of the representation,
414   a single <x:ref>206 (Partial Content)</x:ref> response containing a
415   multipart/byteranges body, or
416   multiple <x:ref>206 (Partial Content)</x:ref> responses, each with one
417   continuous range that is indicated by a <x:ref>Content-Range</x:ref> header
418   field.
419</t>
420</section>
421</section>
422
423<section title="Header Field Definitions" anchor="header.field.definitions">
424<t>
425   This section defines the syntax and semantics of HTTP/1.1 header fields
426   related to range requests and partial responses.
427</t>
428
429<section title="Accept-Ranges" anchor="header.accept-ranges">
430  <iref primary="true" item="Accept-Ranges header field" x:for-anchor=""/>
431  <x:anchor-alias value="Accept-Ranges"/>
432  <x:anchor-alias value="acceptable-ranges"/>
433<t>
434   The "Accept-Ranges" header field allows a resource to indicate
435   its acceptance of range requests.
436</t>
437<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Ranges"/><iref primary="true" item="Grammar" subitem="acceptable-ranges"/>
438  <x:ref>Accept-Ranges</x:ref>     = <x:ref>acceptable-ranges</x:ref>
439  <x:ref>acceptable-ranges</x:ref> = 1#<x:ref>range-unit</x:ref> / "none"
440</artwork></figure>
441<t>
442   Origin servers that accept byte-range requests &MAY; send
443</t>
444<figure><artwork type="example">
445  Accept-Ranges: bytes
446</artwork></figure>
447<t>
448   but are not required to do so. Clients &MAY; generate range
449   requests without having received this header field for the resource
450   involved. Range units are defined in <xref target="range.units"/>.
451</t>
452<t>
453   Servers that do not accept any kind of range request for a
454   resource &MAY; send
455</t>
456<figure><artwork type="example">
457  Accept-Ranges: none
458</artwork></figure>
459<t>
460   to advise the client not to attempt a range request.
461</t>
462</section>
463
464<section title="Content-Range" anchor="header.content-range">
465  <iref primary="true" item="Content-Range header field" x:for-anchor=""/>
466  <x:anchor-alias value="Content-Range"/>
467  <x:anchor-alias value="byte-content-range"/>
468  <x:anchor-alias value="byte-range-resp"/>
469  <x:anchor-alias value="byte-range"/>
470  <x:anchor-alias value="unsatisfied-range"/>
471  <x:anchor-alias value="complete-length"/>
472  <x:anchor-alias value="other-content-range"/>
473  <x:anchor-alias value="other-range-resp"/>
474<t>
475   The "Content-Range" header field is sent with a partial representation to
476   specify where in the full representation the payload body is intended to be
477   applied.
478</t>
479<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Range"/><iref primary="true" item="Grammar" subitem="byte-content-range"/><iref primary="true" item="Grammar" subitem="byte-range-resp"/><iref primary="true" item="Grammar" subitem="byte-range"/><iref primary="true" item="Grammar" subitem="unsatisfied-range"/><iref primary="true" item="Grammar" subitem="other-content-range"/><iref primary="true" item="Grammar" subitem="other-range-resp"/><iref primary="true" item="Grammar" subitem="complete-length"/>
480  <x:ref>Content-Range</x:ref>       = <x:ref>byte-content-range</x:ref>
481                      / <x:ref>other-content-range</x:ref>
482                         
483  <x:ref>byte-content-range</x:ref>  = <x:ref>bytes-unit</x:ref> <x:ref>SP</x:ref>
484                        ( <x:ref>byte-range-resp</x:ref> "/" <x:ref>unsatisfied-range</x:ref> )
485
486  <x:ref>byte-range-resp</x:ref>     = <x:ref>byte-range</x:ref> "/" ( <x:ref>complete-length</x:ref> / "*" )
487  <x:ref>byte-range</x:ref>          = <x:ref>first-byte-pos</x:ref> "-" <x:ref>last-byte-pos</x:ref>
488  <x:ref>unsatisfied-range</x:ref>   = "*/" <x:ref>complete-length</x:ref>
489                         
490  <x:ref>complete-length</x:ref>     = 1*<x:ref>DIGIT</x:ref>
491 
492  <x:ref>other-content-range</x:ref> = <x:ref>other-range-unit</x:ref> <x:ref>SP</x:ref> <x:ref>other-range-resp</x:ref>
493  <x:ref>other-range-resp</x:ref>    = *<x:ref>CHAR</x:ref>
494</artwork></figure>
495<t>  
496   Range units are defined in <xref target="range.units"/>. A recipient of a
497   <x:ref>206 (Partial Content)</x:ref> response containing a
498   <x:ref>Content-Range</x:ref> header field with a <x:ref>range unit</x:ref>
499   that the recipient does not understand &MUST-NOT; attempt to recombine it
500   with a stored representation. A proxy that receives such a message
501   &SHOULD; forward it downstream.
502</t>
503<t>
504   For byte ranges, a sender &SHOULD; indicate the complete length of the
505   representation from which the range has been extracted unless the complete
506   length is unknown or difficult to determine. An asterisk character ("*") in
507   place of the complete-length indicates that the representation length was
508   unknown when the header field was generated.
509</t>
510<t>
511   A Content-Range field value with a <x:ref>byte-range-resp</x:ref> that has
512   a <x:ref>last-byte-pos</x:ref> value less than its
513   <x:ref>first-byte-pos</x:ref> value, or a <x:ref>complete-length</x:ref>
514   value less than or equal to its <x:ref>last-byte-pos</x:ref> value, is
515   invalid. The recipient of an invalid <x:ref>Content-Range</x:ref> &MUST-NOT;
516   attempt to recombine the received content with a stored representation.
517</t>
518<t>
519   A server generating a <x:ref>206 (Partial Content)</x:ref> response to a
520   byte range request &MUST; send, in each body-part of a multipart response
521   or in the header block of a single part response, a Content-Range header
522   field containing a <x:ref>byte-range-resp</x:ref> value that reflects the
523   corresponding range being sent. The following example would apply
524   when the complete length of the selected representation is known by the
525   sender to be 1234 bytes:
526</t>
527<figure><artwork type="example">
528  Content-Range: bytes 42-1233/1234
529</artwork></figure>
530<t>
531   or this second example would apply when the complete length is unknown:
532</t>
533<figure><artwork type="example">
534  Content-Range: bytes 42-1233/*
535</artwork></figure>
536<t>
537   A server generating a <x:ref>416 (Range Not Satisfiable)</x:ref> response
538   to a byte range request &SHOULD; send a Content-Range header field with an
539   <x:ref>unsatisfied-range</x:ref> value, as in the following example:
540</t>
541<figure><artwork type="example">
542  Content-Range: bytes */1234
543</artwork></figure>
544<t>
545   The complete-length in a 416 response indicates the current length of the
546   selected representation, which will be known by the server generating the
547   response because that is how it determined the range to be unsatisfiable.
548</t>
549<t>
550   The "Content-Range" header field has no meaning for status codes that do
551   not explicitly describe its semantic. For this specification, only the
552   <x:ref>206 (Partial Content)</x:ref> and
553   <x:ref>416 (Range Not Satisfiable)</x:ref> status codes describe a meaning
554   for Content-Range.
555</t>
556<t>
557   More examples of Content-Range values, assuming that the representation
558   contains a total of 1234 bytes:
559   <list style="symbols">
560      <t>
561        The first 500 bytes:
562<figure><artwork type="example" x:indent-with="   ">
563  Content-Range: bytes 0-499/1234
564</artwork></figure>
565      </t>   
566      <t>
567        The second 500 bytes:
568<figure><artwork type="example" x:indent-with="   ">
569  Content-Range: bytes 500-999/1234
570</artwork></figure>
571      </t>   
572      <t>
573        All except for the first 500 bytes:
574<figure><artwork type="example" x:indent-with="   ">
575  Content-Range: bytes 500-1233/1234
576</artwork></figure>
577      </t>   
578      <t>
579        The last 500 bytes:
580<figure><artwork type="example" x:indent-with="   ">
581  Content-Range: bytes 734-1233/1234
582</artwork></figure>
583      </t>   
584   </list>
585</t>
586</section>
587
588<section title="If-Range" anchor="header.if-range">
589  <iref primary="true" item="If-Range header field" x:for-anchor=""/>
590  <x:anchor-alias value="If-Range"/>
591<t>
592   If a client has a partial copy of a representation and wishes
593   to have an up-to-date copy of the entire representation, it could use the
594   <x:ref>Range</x:ref> header field with a conditional GET (using
595   either or both of <x:ref>If-Unmodified-Since</x:ref> and
596   <x:ref>If-Match</x:ref>.) However, if the condition fails because the
597   representation has been modified, the client would then have to make a
598   second request to obtain the entire current representation.
599</t>
600<t>
601   The "If-Range" header field allows a client to "short-circuit" the second
602   request. Informally, its meaning is: if the representation is unchanged,
603   send me the part(s) that I am requesting in Range; otherwise, send me the
604   entire representation.
605</t>
606<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Range"/>
607  <x:ref>If-Range</x:ref> = <x:ref>entity-tag</x:ref> / <x:ref>HTTP-date</x:ref>
608</artwork></figure>
609<t>
610   Clients &MUST-NOT; use an entity-tag marked as weak in an If-Range
611   field value and &MUST-NOT; use a <x:ref>Last-Modified</x:ref> date in an
612   If-Range field value unless it has no entity-tag for the representation and
613   the Last-Modified date it does have for the representation is strong
614   in the sense defined by &lastmod-comparison;.
615</t>
616<t>
617   A server that evaluates a conditional range request that is applicable
618   to one of its representations &MUST; evaluate the condition as false if
619   the entity-tag used as a validator is marked as weak or, when an HTTP-date
620   is used as the validator, if the date value is not strong in the sense
621   defined by &lastmod-comparison;. (A server can distinguish between a
622   valid HTTP-date and any form of entity-tag by examining the first
623   two characters.)
624</t>
625<t>
626   The If-Range header field &SHOULD; only be sent by clients together with
627   a Range header field.  The If-Range header field &MUST; be ignored if it
628   is received in a request that does not include a Range header field.
629   The If-Range header field &MUST; be ignored by a server that does not
630   support the sub-range operation.
631</t>
632<t>
633   If the validator given in the If-Range header field matches the current
634   validator for the selected representation of the target resource, then
635   the server &SHOULD; send the specified sub-range of the representation
636   using a <x:ref>206 (Partial Content)</x:ref> response. If the validator
637   does not match, then the server &SHOULD; send the entire representation
638   using a <x:ref>200 (OK)</x:ref> response.
639</t>
640</section>
641
642<section title="Range" anchor="header.range">
643  <iref primary="true" item="Range header field" x:for-anchor=""/>
644
645<section title="Byte Ranges" anchor="byte.ranges">
646<t>
647   Since all HTTP representations are transferred as sequences
648   of bytes, the concept of a byte range is meaningful for any HTTP
649   representation. (However, not all clients and servers need to support byte-range
650   operations.)
651</t>
652<t>
653   Byte range specifications in HTTP apply to the sequence of bytes in
654   the representation data (not necessarily the same as the message body).
655</t>
656<t anchor="rule.ranges-specifier">
657  <x:anchor-alias value="byte-range-set"/>
658  <x:anchor-alias value="byte-range-spec"/>
659  <x:anchor-alias value="byte-ranges-specifier"/>
660  <x:anchor-alias value="first-byte-pos"/>
661  <x:anchor-alias value="last-byte-pos"/>
662  <x:anchor-alias value="ranges-specifier"/>
663  <x:anchor-alias value="suffix-byte-range-spec"/>
664  <x:anchor-alias value="suffix-length"/>
665   A byte range operation &MAY; specify a single range of bytes, or a set
666   of ranges within a single representation.
667</t>
668<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="ranges-specifier"/><iref primary="true" item="Grammar" subitem="byte-ranges-specifier"/><iref primary="true" item="Grammar" subitem="byte-range-set"/><iref primary="true" item="Grammar" subitem="byte-range-spec"/><iref primary="true" item="Grammar" subitem="first-byte-pos"/><iref primary="true" item="Grammar" subitem="last-byte-pos"/>
669  <x:ref>byte-ranges-specifier</x:ref> = <x:ref>bytes-unit</x:ref> "=" <x:ref>byte-range-set</x:ref>
670  <x:ref>byte-range-set</x:ref>  = 1#( <x:ref>byte-range-spec</x:ref> / <x:ref>suffix-byte-range-spec</x:ref> )
671  <x:ref>byte-range-spec</x:ref> = <x:ref>first-byte-pos</x:ref> "-" [ <x:ref>last-byte-pos</x:ref> ]
672  <x:ref>first-byte-pos</x:ref>  = 1*<x:ref>DIGIT</x:ref>
673  <x:ref>last-byte-pos</x:ref>   = 1*<x:ref>DIGIT</x:ref>
674</artwork></figure>
675<t>
676   The first-byte-pos value in a byte-range-spec gives the byte-offset
677   of the first byte in a range. The last-byte-pos value gives the
678   byte-offset of the last byte in the range; that is, the byte
679   positions specified are inclusive. Byte offsets start at zero.
680</t>
681<t>
682   If the last-byte-pos value is present, it &MUST; be greater than or
683   equal to the first-byte-pos in that byte-range-spec, or the byte-range-spec
684   is syntactically invalid. The recipient of a byte-range-set
685   that includes one or more syntactically invalid byte-range-spec
686   values &MUST; ignore the header field that includes that byte-range-set.
687</t>
688<t>
689   If the last-byte-pos value is absent, or if the value is greater than
690   or equal to the current length of the representation data, last-byte-pos is
691   taken to be equal to one less than the current length of the representation
692   in bytes.
693</t>
694<t>
695   By its choice of last-byte-pos, a client can limit the number of
696   bytes retrieved without knowing the size of the representation.
697</t>
698<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="suffix-byte-range-spec"/><iref primary="true" item="Grammar" subitem="suffix-length"/>
699  <x:ref>suffix-byte-range-spec</x:ref> = "-" <x:ref>suffix-length</x:ref>
700  <x:ref>suffix-length</x:ref> = 1*<x:ref>DIGIT</x:ref>
701</artwork></figure>
702<t>
703   A suffix-byte-range-spec is used to specify the suffix of the
704   representation data, of a length given by the suffix-length value. (That is,
705   this form specifies the last N bytes of a representation.) If the
706   representation is shorter than the specified suffix-length, the entire
707   representation is used.
708</t>
709<t>
710   If a syntactically valid byte-range-set includes at least one byte-range-spec
711   whose first-byte-pos is less than the current length of
712   the representation, or at least one suffix-byte-range-spec with a non-zero
713   suffix-length, then the byte-range-set is satisfiable.
714   Otherwise, the byte-range-set is unsatisfiable. If the byte-range-set
715   is unsatisfiable, the server &SHOULD; send a response with a
716   <x:ref>416 (Range Not Satisfiable)</x:ref> status code. Otherwise, the server
717   &SHOULD; send a response with a <x:ref>206 (Partial Content)</x:ref> status code
718   containing the satisfiable ranges of the representation.
719</t>
720<t>
721   In the byte range syntax, <x:ref>first-byte-pos</x:ref>,
722   <x:ref>last-byte-pos</x:ref>, and <x:ref>suffix-length</x:ref> are
723   expressed as decimal number of octets.  Since there is no predefined limit
724   to the length of an HTTP payload, recipients &SHOULD; anticipate
725   potentially large decimal numerals and prevent parsing errors due to integer
726   conversion overflows.
727</t>
728<t>
729   Examples of byte-ranges-specifier values (assuming a representation of
730   length 10000):
731  <list style="symbols">
732     <t>The first 500 bytes (byte offsets 0-499, inclusive):
733<figure><artwork type="example" x:indent-with="   ">
734  bytes=0-499
735</artwork></figure>
736    </t>
737     <t>The second 500 bytes (byte offsets 500-999, inclusive):
738<figure><artwork type="example" x:indent-with="   ">
739  bytes=500-999
740</artwork></figure>
741    </t>
742     <t>The final 500 bytes (byte offsets 9500-9999, inclusive):
743<figure><artwork type="example" x:indent-with="   ">
744  bytes=-500
745</artwork></figure>
746    Or:
747<figure><artwork type="example" x:indent-with="   ">
748  bytes=9500-
749</artwork></figure>
750    </t>
751     <t>The first and last bytes only (bytes 0 and 9999):
752<figure><artwork type="example" x:indent-with="   ">
753  bytes=0-0,-1
754</artwork></figure>
755     </t>
756     <t>Several legal but not canonical specifications of the second 500
757        bytes (byte offsets 500-999, inclusive):
758<figure><artwork type="example" x:indent-with="   ">
759  bytes=500-600,601-999
760  bytes=500-700,601-999
761</artwork></figure>
762     </t>
763  </list>
764</t>
765</section>
766
767<section title="Range Retrieval Requests" anchor="range.retrieval.requests">
768  <x:anchor-alias value="Range"/>
769  <x:anchor-alias value="other-ranges-specifier"/>
770  <x:anchor-alias value="other-range-set"/>
771<t>
772   The "Range" header field on a GET request modifies the method semantics to
773   request transfer of only one or more sub-ranges of the selected
774   representation data in a successful response, rather than the entire
775   representation data.
776</t>
777<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Range"/>
778  <x:ref>Range</x:ref> = <x:ref>byte-ranges-specifier</x:ref> / <x:ref>other-ranges-specifier</x:ref>
779  <x:ref>other-ranges-specifier</x:ref> = <x:ref>other-range-unit</x:ref> "=" <x:ref>other-range-set</x:ref>
780  <x:ref>other-range-set</x:ref> = 1*<x:ref>CHAR</x:ref>
781</artwork></figure>
782<t>
783   A server &MAY; ignore the Range header field. However, origin servers and
784   intermediate caches ought to support byte ranges when possible, since Range
785   supports efficient recovery from partially failed transfers and partial
786   retrieval of large representations. A server &MUST; ignore a Range header
787   field received with a request method other than GET.
788</t>
789<t>
790   An origin server &MUST; ignore a <x:ref>Range</x:ref> header field that
791   contains a range unit it does not understand. A proxy &MAY; either discard
792   a <x:ref>Range</x:ref> header field that contains a range unit it does not
793   understand or pass it to the next inbound server when forwarding the
794   request.
795</t>
796<t>
797   The Range header field is evaluated after evaluating the preconditions of
798   <xref target="Part4"/> and only if the result of their evaluation is
799   leading toward a <x:ref>200 (OK)</x:ref> response. In other words, Range
800   is ignored when a conditional GET would result in a
801   <x:ref>304 (Not Modified)</x:ref> response.
802</t>
803<t>
804   The If-Range header field (<xref target="header.if-range"/>) can be used as
805   a precondition to applying the Range header field.
806</t>
807<t>
808   If all of the preconditions are true, the server supports the Range header
809   field for the target resource, the specified range(s) are syntactically
810   correct (as defined in <xref target="byte.ranges"/>), and at least one of
811   the ranges has a non-empty intersection with the current selected
812   representation extent, then the server &MAY; respond with a status code of
813   <x:ref>206 (Partial Content)</x:ref> and a payload containing one or more
814   partial representations that correspond to those requested, as defined in
815   <xref target="range.response"/>.
816</t>
817</section>
818</section>
819</section>
820
821<section title="IANA Considerations" anchor="IANA.considerations">
822
823<section title="Status Code Registration" anchor="status.code.registration">
824<t>
825   The HTTP Status Code Registry located at <eref target="http://www.iana.org/assignments/http-status-codes"/>
826   shall be updated with the registrations below:
827</t>
828<?BEGININC p5-range.iana-status-codes ?>
829<!--AUTOGENERATED FROM extract-status-code-defs.xslt, do not edit manually-->
830<texttable align="left" suppress-title="true" anchor="iana.status.code.registration.table">
831   <ttcol>Value</ttcol>
832   <ttcol>Description</ttcol>
833   <ttcol>Reference</ttcol>
834   <c>206</c>
835   <c>Partial Content</c>
836   <c>
837      <xref target="status.206"/>
838   </c>
839   <c>416</c>
840   <c>Range Not Satisfiable</c>
841   <c>
842      <xref target="status.416"/>
843   </c>
844</texttable>
845<!--(END)-->
846<?ENDINC p5-range.iana-status-codes ?>
847</section>
848
849<section title="Header Field Registration" anchor="header.field.registration">
850<t>
851   The Message Header Field Registry located at <eref target="http://www.iana.org/assignments/message-headers/message-header-index.html"/> shall be updated
852   with the permanent registrations below (see <xref target="BCP90"/>):
853</t>
854<?BEGININC p5-range.iana-headers ?>
855<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
856<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
857   <ttcol>Header Field Name</ttcol>
858   <ttcol>Protocol</ttcol>
859   <ttcol>Status</ttcol>
860   <ttcol>Reference</ttcol>
861
862   <c>Accept-Ranges</c>
863   <c>http</c>
864   <c>standard</c>
865   <c>
866      <xref target="header.accept-ranges"/>
867   </c>
868   <c>Content-Range</c>
869   <c>http</c>
870   <c>standard</c>
871   <c>
872      <xref target="header.content-range"/>
873   </c>
874   <c>If-Range</c>
875   <c>http</c>
876   <c>standard</c>
877   <c>
878      <xref target="header.if-range"/>
879   </c>
880   <c>Range</c>
881   <c>http</c>
882   <c>standard</c>
883   <c>
884      <xref target="header.range"/>
885   </c>
886</texttable>
887<!--(END)-->
888<?ENDINC p5-range.iana-headers ?>
889<t>
890   The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".
891</t>
892</section>
893
894<section title="Range Specifier Registration" anchor="range.specifier.registration">
895<t>
896  The registration procedure for HTTP Range Specifiers is defined by
897  <xref target="range.unit.registry"/> of this document.
898</t>
899<t>
900   The HTTP Range Specifier Registry shall be created at <eref target="http://www.iana.org/assignments/http-range-specifiers"/>
901   and be populated with the registrations below:
902</t>
903<texttable align="left" suppress-title="true" anchor="iana.range.specifiers.table">
904   <ttcol>Range Specifier Name</ttcol>
905   <ttcol>Description</ttcol>
906   <ttcol>Reference</ttcol>
907
908   <c>bytes</c>
909   <c>a range of octets</c>
910   <c><xref target="range.units"/></c>
911
912   <c>none</c>
913   <c>reserved as keyword, indicating no ranges are supported</c>
914   <c><xref target="header.accept-ranges"/></c>
915</texttable>
916<t>
917   The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".
918</t>
919</section>
920</section>
921
922<section title="Security Considerations" anchor="security.considerations">
923<t>
924   This section is meant to inform developers, information providers, and
925   users of known security concerns specific to the HTTP/1.1 range
926   request mechanisms. More general security considerations are addressed
927   in HTTP messaging &messaging; and semantics &semantics;.
928</t>
929
930<section title="Overlapping Ranges" anchor="overlapping.ranges">
931<t>
932   Range requests containing overlapping ranges can lead to a situation
933   where the server is sending far more data than the size of the complete
934   resource representation.
935</t>
936</section>
937</section>
938
939<section title="Acknowledgments" anchor="acks">
940<t>
941  See &acks;.
942</t>
943</section>
944</middle>
945<back>
946
947<references title="Normative References">
948
949<reference anchor="Part1">
950  <front>
951    <title>Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
952    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
953      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
954      <address><email>fielding@gbiv.com</email></address>
955    </author>
956    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
957      <organization abbrev="greenbytes">greenbytes GmbH</organization>
958      <address><email>julian.reschke@greenbytes.de</email></address>
959    </author>
960    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
961  </front>
962  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"/>
963  <x:source href="p1-messaging.xml" basename="p1-messaging">
964    <x:defines>Content-Length</x:defines>
965  </x:source>
966</reference>
967
968<reference anchor="Part2">
969  <front>
970    <title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
971    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
972      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
973      <address><email>fielding@gbiv.com</email></address>
974    </author>
975    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
976      <organization abbrev="greenbytes">greenbytes GmbH</organization>
977      <address><email>julian.reschke@greenbytes.de</email></address>
978    </author>
979    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
980  </front>
981  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-&ID-VERSION;"/>
982  <x:source href="p2-semantics.xml" basename="p2-semantics">
983    <x:defines>200 (OK)</x:defines>
984    <x:defines>410 (Gone)</x:defines>
985    <x:defines>Content-Location</x:defines>
986    <x:defines>Content-Type</x:defines>
987    <x:defines>Location</x:defines>
988    <x:defines>Vary</x:defines>
989  </x:source>
990</reference>
991
992<reference anchor="Part4">
993  <front>
994    <title>Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests</title>
995    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
996      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
997      <address><email>fielding@gbiv.com</email></address>
998    </author>
999    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1000      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1001      <address><email>julian.reschke@greenbytes.de</email></address>
1002    </author>
1003    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1004  </front>
1005  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-&ID-VERSION;"/>
1006  <x:source href="p4-conditional.xml" basename="p4-conditional">
1007    <x:defines>304 (Not Modified)</x:defines>
1008    <x:defines>ETag</x:defines>
1009    <x:defines>If-Match</x:defines>
1010    <x:defines>If-Modified-Since</x:defines>
1011    <x:defines>If-None-Match</x:defines>
1012    <x:defines>If-Unmodified-Since</x:defines>
1013    <x:defines>Last-Modified</x:defines>
1014  </x:source>
1015</reference>
1016
1017<reference anchor="Part6">
1018  <front>
1019    <title>Hypertext Transfer Protocol (HTTP/1.1): Caching</title>
1020    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1021      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
1022      <address><email>fielding@gbiv.com</email></address>
1023    </author>
1024    <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor">
1025      <organization>Akamai</organization>
1026      <address><email>mnot@mnot.net</email></address>
1027    </author>
1028    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1029      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1030      <address><email>julian.reschke@greenbytes.de</email></address>
1031    </author>
1032    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1033  </front>
1034  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
1035  <x:source href="p6-cache.xml" basename="p6-cache">
1036    <x:defines>Cache-Control</x:defines>
1037    <x:defines>Expires</x:defines>
1038  </x:source>
1039</reference>
1040
1041<reference anchor="RFC2046">
1042  <front>
1043    <title abbrev="Media Types">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</title>
1044    <author initials="N." surname="Freed" fullname="Ned Freed">
1045      <organization>Innosoft International, Inc.</organization>
1046      <address><email>ned@innosoft.com</email></address>
1047    </author>
1048    <author initials="N." surname="Borenstein" fullname="Nathaniel S. Borenstein">
1049      <organization>First Virtual Holdings</organization>
1050      <address><email>nsb@nsb.fv.com</email></address>
1051    </author>
1052    <date month="November" year="1996"/>
1053  </front>
1054  <seriesInfo name="RFC" value="2046"/>
1055</reference>
1056
1057<reference anchor="RFC2119">
1058  <front>
1059    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
1060    <author initials="S." surname="Bradner" fullname="Scott Bradner">
1061      <organization>Harvard University</organization>
1062      <address><email>sob@harvard.edu</email></address>
1063    </author>
1064    <date month="March" year="1997"/>
1065  </front>
1066  <seriesInfo name="BCP" value="14"/>
1067  <seriesInfo name="RFC" value="2119"/>
1068</reference>
1069
1070<reference anchor="RFC5234">
1071  <front>
1072    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
1073    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
1074      <organization>Brandenburg InternetWorking</organization>
1075      <address>
1076        <email>dcrocker@bbiw.net</email>
1077      </address> 
1078    </author>
1079    <author initials="P." surname="Overell" fullname="Paul Overell">
1080      <organization>THUS plc.</organization>
1081      <address>
1082        <email>paul.overell@thus.net</email>
1083      </address>
1084    </author>
1085    <date month="January" year="2008"/>
1086  </front>
1087  <seriesInfo name="STD" value="68"/>
1088  <seriesInfo name="RFC" value="5234"/>
1089</reference>
1090
1091</references>
1092
1093<references title="Informative References">
1094
1095<reference anchor="RFC2616">
1096  <front>
1097    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
1098    <author initials="R." surname="Fielding" fullname="R. Fielding">
1099      <organization>University of California, Irvine</organization>
1100      <address><email>fielding@ics.uci.edu</email></address>
1101    </author>
1102    <author initials="J." surname="Gettys" fullname="J. Gettys">
1103      <organization>W3C</organization>
1104      <address><email>jg@w3.org</email></address>
1105    </author>
1106    <author initials="J." surname="Mogul" fullname="J. Mogul">
1107      <organization>Compaq Computer Corporation</organization>
1108      <address><email>mogul@wrl.dec.com</email></address>
1109    </author>
1110    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
1111      <organization>MIT Laboratory for Computer Science</organization>
1112      <address><email>frystyk@w3.org</email></address>
1113    </author>
1114    <author initials="L." surname="Masinter" fullname="L. Masinter">
1115      <organization>Xerox Corporation</organization>
1116      <address><email>masinter@parc.xerox.com</email></address>
1117    </author>
1118    <author initials="P." surname="Leach" fullname="P. Leach">
1119      <organization>Microsoft Corporation</organization>
1120      <address><email>paulle@microsoft.com</email></address>
1121    </author>
1122    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
1123      <organization>W3C</organization>
1124      <address><email>timbl@w3.org</email></address>
1125    </author>
1126    <date month="June" year="1999"/>
1127  </front>
1128  <seriesInfo name="RFC" value="2616"/>
1129</reference>
1130
1131<reference anchor='BCP90'>
1132  <front>
1133    <title>Registration Procedures for Message Header Fields</title>
1134    <author initials='G.' surname='Klyne' fullname='G. Klyne'>
1135      <organization>Nine by Nine</organization>
1136      <address><email>GK-IETF@ninebynine.org</email></address>
1137    </author>
1138    <author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
1139      <organization>BEA Systems</organization>
1140      <address><email>mnot@pobox.com</email></address>
1141    </author>
1142    <author initials='J.' surname='Mogul' fullname='J. Mogul'>
1143      <organization>HP Labs</organization>
1144      <address><email>JeffMogul@acm.org</email></address>
1145    </author>
1146    <date year='2004' month='September' />
1147  </front>
1148  <seriesInfo name='BCP' value='90' />
1149  <seriesInfo name='RFC' value='3864' />
1150</reference>
1151
1152<reference anchor="BCP13">
1153  <front>
1154    <title>Media Type Specifications and Registration Procedures</title>
1155    <author initials="N." surname="Freed" fullname="N. Freed">
1156      <organization>Sun Microsystems</organization>
1157      <address>
1158        <email>ned.freed@mrochek.com</email>
1159      </address>
1160    </author>
1161    <author initials="J." surname="Klensin" fullname="J. Klensin">
1162      <address>
1163        <email>klensin+ietf@jck.com</email>
1164      </address>
1165    </author>
1166    <date year="2005" month="December"/>
1167  </front>
1168  <seriesInfo name="BCP" value="13"/>
1169  <seriesInfo name="RFC" value="4288"/>
1170</reference>
1171
1172<reference anchor='RFC5226'>
1173  <front>
1174    <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
1175    <author initials='T.' surname='Narten' fullname='T. Narten'>
1176      <organization>IBM</organization>
1177      <address><email>narten@us.ibm.com</email></address>
1178    </author>
1179    <author initials='H.' surname='Alvestrand' fullname='H. Alvestrand'>
1180      <organization>Google</organization>
1181      <address><email>Harald@Alvestrand.no</email></address>
1182    </author>
1183    <date year='2008' month='May' />
1184  </front>
1185  <seriesInfo name='BCP' value='26' />
1186  <seriesInfo name='RFC' value='5226' />
1187</reference>
1188
1189</references>
1190
1191<section title="Internet Media Type multipart/byteranges" anchor="internet.media.type.multipart.byteranges">
1192<iref item="Media Type" subitem="multipart/byteranges" primary="true"/>
1193<iref item="multipart/byteranges Media Type" primary="true"/>
1194<t>
1195   When an HTTP <x:ref>206 (Partial Content)</x:ref> response message includes the
1196   content of multiple ranges (a response to a request for multiple
1197   non-overlapping ranges), these are transmitted as a multipart
1198   message body (<xref target="RFC2046" x:fmt="," x:sec="5.1"/>). The media type for this purpose is called
1199   "multipart/byteranges".  The following is to be registered with IANA <xref target="BCP13"/>.
1200</t>
1201<t>
1202   The multipart/byteranges media type includes one or more parts, each
1203   with its own <x:ref>Content-Type</x:ref> and <x:ref>Content-Range</x:ref>
1204   fields. The required boundary parameter specifies the boundary string used
1205   to separate each body-part.
1206</t>
1207<t>
1208  <list style="hanging" x:indent="12em">
1209    <t hangText="Type name:">
1210      multipart
1211    </t>
1212    <t hangText="Subtype name:">
1213      byteranges
1214    </t>
1215    <t hangText="Required parameters:">
1216      boundary
1217    </t>
1218    <t hangText="Optional parameters:">
1219      none
1220    </t>
1221    <t hangText="Encoding considerations:">
1222      only "7bit", "8bit", or "binary" are permitted
1223    </t>
1224    <t hangText="Security considerations:">
1225      none
1226    </t>
1227    <t hangText="Interoperability considerations:">
1228      none
1229    </t>
1230    <t hangText="Published specification:">
1231      This specification (see <xref target="internet.media.type.multipart.byteranges"/>).
1232    </t>
1233    <t hangText="Applications that use this media type:">
1234      HTTP components supporting multiple ranges in a single request.
1235    </t>
1236    <t hangText="Additional information:">
1237      <list style="hanging">
1238        <t hangText="Magic number(s):">none</t>
1239        <t hangText="File extension(s):">none</t>
1240        <t hangText="Macintosh file type code(s):">none</t>
1241      </list>
1242    </t>
1243    <t hangText="Person and email address to contact for further information:">
1244      See Authors Section.
1245    </t>
1246    <t hangText="Intended usage:">
1247      COMMON
1248    </t>
1249    <t hangText="Restrictions on usage:">
1250      none
1251    </t>
1252    <t hangText="Author/Change controller:">
1253      IESG
1254    </t>
1255  </list>
1256</t>
1257<x:note>
1258  <t>
1259    &Note; Despite the name "multipart/byteranges" is not limited to the byte ranges only.
1260  </t>
1261</x:note>
1262<figure><preamble>
1263   For example:
1264</preamble><artwork type="example">
1265  HTTP/1.1 206 Partial Content
1266  Date: Wed, 15 Nov 1995 06:25:24 GMT
1267  Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
1268  Content-Length: 1741
1269  Content-Type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
1270 
1271  --THIS_STRING_SEPARATES
1272  Content-Type: application/pdf
1273  Content-Range: bytes 500-999/8000
1274 
1275  ...the first range...
1276  --THIS_STRING_SEPARATES
1277  Content-Type: application/pdf
1278  Content-Range: bytes 7000-7999/8000
1279 
1280  ...the second range
1281  --THIS_STRING_SEPARATES--
1282</artwork></figure>
1283<figure><preamble>
1284   Another example, using the "exampleunit" range unit:
1285</preamble>
1286<artwork type="example">
1287  HTTP/1.1 206 Partial Content
1288  Date: Tue, 14 Nov 1995 06:25:24 GMT
1289  Last-Modified: Tue, 14 July 04:58:08 GMT
1290  Content-Length: 2331785
1291  Content-Type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
1292 
1293  --THIS_STRING_SEPARATES
1294  Content-Type: video/example
1295  Content-Range: exampleunit 1.2-4.3/25
1296 
1297  ...the first range...
1298  --THIS_STRING_SEPARATES
1299  Content-Type: video/example
1300  Content-Range: exampleunit 11.2-14.3/25
1301 
1302  ...the second range
1303  --THIS_STRING_SEPARATES--
1304</artwork>
1305</figure>
1306<t>
1307  Notes:
1308  <list style="numbers">
1309      <t>Additional CRLFs &MAY; precede the first boundary string in the body.</t>
1310
1311      <t>Although <xref target="RFC2046"/> permits the boundary string to be
1312         quoted, some existing implementations handle a quoted boundary
1313         string incorrectly.</t>
1314
1315      <t>A number of clients and servers were coded to an early draft
1316         of the byteranges specification to use a media type of
1317         multipart/x-byteranges<iref item="multipart/x-byteranges Media Type"/><iref item="Media Type" subitem="multipart/x-byteranges"/>, which is almost, but not quite
1318         compatible with the version documented in HTTP/1.1.</t>
1319  </list>
1320</t>
1321</section>
1322
1323<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
1324
1325<t>
1326  A weak validator cannot be used in a <x:ref>206</x:ref> response.
1327  (<xref target="status.206"/>)
1328</t>
1329<t>
1330  The Content-Range header field only has meaning when the status code
1331  explicitly defines its use.
1332  (<xref target="header.content-range" />)
1333</t>
1334<t>
1335  Servers are given more leeway in how they respond to a range request,
1336  in order to mitigate abuse by malicious (or just greedy) clients.
1337</t>
1338<t>
1339  multipart/byteranges can consist of a single part.
1340  (<xref target="internet.media.type.multipart.byteranges"/>)
1341</t>
1342<t>
1343  This specification introduces a Range Specifier Registry.
1344  (<xref target="range.unit.registry"/>)
1345</t>
1346</section>
1347
1348<section title="Imported ABNF" anchor="imported.abnf">
1349  <x:anchor-alias value="ALPHA"/>
1350  <x:anchor-alias value="CHAR"/>
1351  <x:anchor-alias value="CR"/>
1352  <x:anchor-alias value="DIGIT"/>
1353  <x:anchor-alias value="LF"/>
1354  <x:anchor-alias value="OCTET"/>
1355  <x:anchor-alias value="SP"/>
1356  <x:anchor-alias value="VCHAR"/>
1357  <x:anchor-alias value="token"/>
1358  <x:anchor-alias value="OWS"/>
1359  <x:anchor-alias value="HTTP-date"/>
1360  <x:anchor-alias value="entity-tag"/>
1361<t>
1362  The following core rules are included by
1363  reference, as defined in <xref target="RFC5234" x:fmt="of" x:sec="B.1"/>:
1364  ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls),
1365  DIGIT (decimal 0-9), DQUOTE (double quote),
1366  HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed),
1367  OCTET (any 8-bit sequence of data), SP (space), and
1368  VCHAR (any visible US-ASCII character).
1369</t>
1370<t>
1371  Note that all rules derived from <x:ref>token</x:ref> are to
1372  be compared case-insensitively, like <x:ref>range-unit</x:ref> and
1373  <x:ref>acceptable-ranges</x:ref>.
1374</t>
1375<t>
1376  The rules below are defined in <xref target="Part1"/>:
1377</t>
1378<figure><artwork type="abnf2616">
1379  <x:ref>OWS</x:ref>        = &lt;OWS, defined in &whitespace;&gt;
1380  <x:ref>token</x:ref>      = &lt;token, defined in &field-components;&gt;
1381</artwork></figure>
1382<t>
1383  The rules below are defined in other parts:
1384</t>
1385<figure><artwork type="abnf2616">
1386  <x:ref>HTTP-date</x:ref>  = &lt;HTTP-date, defined in &http-date;&gt;
1387  <x:ref>entity-tag</x:ref> = &lt;entity-tag, defined in &entity-tags;&gt;
1388</artwork></figure>
1389</section>
1390
1391<?BEGININC p5-range.abnf-appendix ?>
1392<section xmlns:x="http://purl.org/net/xml2rfc/ext" title="Collected ABNF" anchor="collected.abnf">
1393<figure>
1394<artwork type="abnf" name="p5-range.parsed-abnf">
1395<x:ref>Accept-Ranges</x:ref> = acceptable-ranges
1396
1397<x:ref>Content-Range</x:ref> = byte-content-range / other-content-range
1398
1399<x:ref>HTTP-date</x:ref> = &lt;HTTP-date, defined in [Part2], Section 7.1.1.1&gt;
1400
1401<x:ref>If-Range</x:ref> = entity-tag / HTTP-date
1402
1403<x:ref>OWS</x:ref> = &lt;OWS, defined in [Part1], Section 3.2.3&gt;
1404
1405<x:ref>Range</x:ref> = byte-ranges-specifier / other-ranges-specifier
1406
1407<x:ref>acceptable-ranges</x:ref> = ( *( "," OWS ) range-unit *( OWS "," [ OWS
1408 range-unit ] ) ) / "none"
1409
1410<x:ref>byte-content-range</x:ref> = bytes-unit SP ( byte-range-resp "/"
1411 unsatisfied-range )
1412<x:ref>byte-range</x:ref> = first-byte-pos "-" last-byte-pos
1413<x:ref>byte-range-resp</x:ref> = byte-range "/" ( complete-length / "*" )
1414<x:ref>byte-range-set</x:ref> = *( "," OWS ) ( byte-range-spec /
1415 suffix-byte-range-spec ) *( OWS "," [ OWS ( byte-range-spec /
1416 suffix-byte-range-spec ) ] )
1417<x:ref>byte-range-spec</x:ref> = first-byte-pos "-" [ last-byte-pos ]
1418<x:ref>byte-ranges-specifier</x:ref> = bytes-unit "=" byte-range-set
1419<x:ref>bytes-unit</x:ref> = "bytes"
1420
1421<x:ref>complete-length</x:ref> = 1*DIGIT
1422
1423<x:ref>entity-tag</x:ref> = &lt;entity-tag, defined in [Part4], Section 2.3&gt;
1424
1425<x:ref>first-byte-pos</x:ref> = 1*DIGIT
1426
1427<x:ref>last-byte-pos</x:ref> = 1*DIGIT
1428
1429<x:ref>other-content-range</x:ref> = other-range-unit SP other-range-resp
1430<x:ref>other-range-resp</x:ref> = *CHAR
1431<x:ref>other-range-set</x:ref> = 1*CHAR
1432<x:ref>other-range-unit</x:ref> = token
1433<x:ref>other-ranges-specifier</x:ref> = other-range-unit "=" other-range-set
1434
1435<x:ref>range-unit</x:ref> = bytes-unit / other-range-unit
1436
1437<x:ref>suffix-byte-range-spec</x:ref> = "-" suffix-length
1438<x:ref>suffix-length</x:ref> = 1*DIGIT
1439
1440<x:ref>token</x:ref> = &lt;token, defined in [Part1], Section 3.2.6&gt;
1441
1442<x:ref>unsatisfied-range</x:ref> = "*/" complete-length
1443</artwork>
1444</figure>
1445</section>
1446<?ENDINC p5-range.abnf-appendix ?>
1447
1448
1449<section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
1450<t>
1451  Changes up to the first Working Group Last Call draft are summarized
1452  in <eref target="http://tools.ietf.org/html/draft-ietf-httpbis-p5-range-19#appendix-D"/>.
1453</t>
1454
1455<section title="Since draft-ietf-httpbis-p5-range-19" anchor="changes.since.19">
1456<t>
1457  Closed issues:
1458  <list style="symbols">
1459    <t>
1460      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/358"/>:
1461      "ABNF list expansion code problem"
1462    </t>
1463    <t>
1464      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/361"/>:
1465      "ABNF requirements for recipients"
1466    </t>
1467    <t>
1468      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/367"/>:
1469      "reserve 'none' as byte range unit"
1470    </t>
1471    <t>
1472      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/368"/>:
1473      "note introduction of new IANA registries as normative changes"
1474    </t>
1475    <t>
1476      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/369"/>:
1477      "range units vs leading zeroes vs size"
1478    </t>
1479  </list>
1480</t>
1481</section>
1482
1483<section title="Since draft-ietf-httpbis-p5-range-20" anchor="changes.since.20">
1484<t>
1485  <list style="symbols">
1486    <t>
1487      Conformance criteria and considerations regarding error handling are
1488      now defined in Part 1.
1489    </t>
1490  </list>
1491</t>
1492</section>
1493
1494<section title="Since draft-ietf-httpbis-p5-range-21" anchor="changes.since.21">
1495<t>
1496  None yet.
1497</t>
1498</section>
1499
1500</section>
1501
1502</back>
1503</rfc>
Note: See TracBrowser for help on using the repository browser.