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

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

(editorial) rephrasing to better target the subject of requirements

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