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

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

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