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

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

oops, fix a few phrasing of return vs send due to last commit

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