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

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

(editorial) move byte ranges definition into range unit section near start of document; no text changes

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