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

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

(editorial) be more consistent when referring to a "body", preferring the
defined terms for message (body), payload (body), and representation (data).

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