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

Last change on this file since 1883 was 1875, checked in by fielding@…, 7 years ago

Be more consistent regarding targeting conformance requirements.
Only define conformance criteria once, but repeat required nits.

Remove antiquated requirement about media type parameters not being
recognized by 1993-era browsers.

Add reference to TLS in p1.

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