source: draft-ietf-httpbis/17/draft-ietf-httpbis-p5-range-17.xml @ 1529

Last change on this file since 1529 was 1500, checked in by julian.reschke@…, 8 years ago

fix mime types

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/xml
File size: 64.0 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3    This XML document is the output of clean-for-DTD.xslt; a tool that strips
4    extensions to RFC2629(bis) from documents for processing with xml2rfc.
5-->
6<?xml-stylesheet type='text/xsl' href='../myxml2rfc.xslt'?>
7<?rfc toc="yes" ?>
8<?rfc symrefs="yes" ?>
9<?rfc sortrefs="yes" ?>
10<?rfc compact="yes"?>
11<?rfc subcompact="no" ?>
12<?rfc linkmailto="no" ?>
13<?rfc editing="no" ?>
14<?rfc comments="yes"?>
15<?rfc inline="yes"?>
16<?rfc rfcedstyle="yes"?>
17<!DOCTYPE rfc
18  PUBLIC "" "rfc2629.dtd">
19<rfc obsoletes="2616" category="std" ipr="pre5378Trust200902" docName="draft-ietf-httpbis-p5-range-17">
20<front>
21
22  <title abbrev="HTTP/1.1, Part 5">HTTP/1.1, part 5: Range Requests and Partial Responses</title>
23
24  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
25    <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
26    <address>
27      <postal>
28        <street>345 Park Ave</street>
29        <city>San Jose</city>
30        <region>CA</region>
31        <code>95110</code>
32        <country>USA</country>
33      </postal>
34      <email>fielding@gbiv.com</email>
35      <uri>http://roy.gbiv.com/</uri>
36    </address>
37  </author>
38
39  <author initials="J." surname="Gettys" fullname="Jim Gettys">
40    <organization abbrev="Alcatel-Lucent">Alcatel-Lucent Bell Labs</organization>
41    <address>
42      <postal>
43        <street>21 Oak Knoll Road</street>
44        <city>Carlisle</city>
45        <region>MA</region>
46        <code>01741</code>
47        <country>USA</country>
48      </postal>
49      <email>jg@freedesktop.org</email>
50      <uri>http://gettys.wordpress.com/</uri>
51    </address>
52  </author>
53 
54  <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
55    <organization abbrev="HP">Hewlett-Packard Company</organization>
56    <address>
57      <postal>
58        <street>HP Labs, Large Scale Systems Group</street>
59        <street>1501 Page Mill Road, MS 1177</street>
60        <city>Palo Alto</city>
61        <region>CA</region>
62        <code>94304</code>
63        <country>USA</country>
64      </postal>
65      <email>JeffMogul@acm.org</email>
66    </address>
67  </author>
68
69  <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
70    <organization abbrev="Microsoft">Microsoft Corporation</organization>
71    <address>
72      <postal>
73        <street>1 Microsoft Way</street>
74        <city>Redmond</city>
75        <region>WA</region>
76        <code>98052</code>
77        <country>USA</country>
78      </postal>
79      <email>henrikn@microsoft.com</email>
80    </address>
81  </author>
82
83  <author initials="L." surname="Masinter" fullname="Larry Masinter">
84    <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
85    <address>
86      <postal>
87        <street>345 Park Ave</street>
88        <city>San Jose</city>
89        <region>CA</region>
90        <code>95110</code>
91        <country>USA</country>
92      </postal>
93      <email>LMM@acm.org</email>
94      <uri>http://larry.masinter.net/</uri>
95    </address>
96  </author>
97 
98  <author initials="P." surname="Leach" fullname="Paul J. Leach">
99    <organization abbrev="Microsoft">Microsoft Corporation</organization>
100    <address>
101      <postal>
102        <street>1 Microsoft Way</street>
103        <city>Redmond</city>
104        <region>WA</region>
105        <code>98052</code>
106      </postal>
107      <email>paulle@microsoft.com</email>
108    </address>
109  </author>
110   
111  <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
112    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
113    <address>
114      <postal>
115        <street>MIT Computer Science and Artificial Intelligence Laboratory</street>
116        <street>The Stata Center, Building 32</street>
117        <street>32 Vassar Street</street>
118        <city>Cambridge</city>
119        <region>MA</region>
120        <code>02139</code>
121        <country>USA</country>
122      </postal>
123      <email>timbl@w3.org</email>
124      <uri>http://www.w3.org/People/Berners-Lee/</uri>
125    </address>
126  </author>
127
128  <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
129    <organization abbrev="W3C">World Wide Web Consortium</organization>
130    <address>
131      <postal>
132        <street>W3C / ERCIM</street>
133        <street>2004, rte des Lucioles</street>
134        <city>Sophia-Antipolis</city>
135        <region>AM</region>
136        <code>06902</code>
137        <country>France</country>
138      </postal>
139      <email>ylafon@w3.org</email>
140      <uri>http://www.raubacapeu.net/people/yves/</uri>
141    </address>
142  </author>
143
144  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
145    <organization abbrev="greenbytes">greenbytes GmbH</organization>
146    <address>
147      <postal>
148        <street>Hafenweg 16</street>
149        <city>Muenster</city><region>NW</region><code>48155</code>
150        <country>Germany</country>
151      </postal>
152      <phone>+49 251 2807760</phone>
153      <facsimile>+49 251 2807761</facsimile>
154      <email>julian.reschke@greenbytes.de</email>
155      <uri>http://greenbytes.de/tech/webdav/</uri>
156    </address>
157  </author>
158
159  <date month="October" year="2011" day="31"/>
160  <workgroup>HTTPbis Working Group</workgroup>
161
162<abstract>
163<t>
164   The Hypertext Transfer Protocol (HTTP) is an application-level protocol for
165   distributed, collaborative, hypertext information systems. HTTP has been in
166   use by the World Wide Web global information initiative since 1990. This
167   document is Part 5 of the seven-part specification that defines the protocol
168   referred to as "HTTP/1.1" and, taken together, obsoletes RFC 2616.
169</t>
170<t>
171   Part 5 defines range-specific requests and the rules for constructing and
172   combining responses to those requests.
173</t>
174</abstract>
175
176<note title="Editorial Note (To be removed by RFC Editor)">
177  <t>
178    Discussion of this draft should take place on the HTTPBIS working group
179    mailing list (ietf-http-wg@w3.org), which is archived at
180    <eref target="http://lists.w3.org/Archives/Public/ietf-http-wg/"/>.
181  </t>
182  <t>
183    The current issues list is at
184    <eref target="http://tools.ietf.org/wg/httpbis/trac/report/3"/> and related
185    documents (including fancy diffs) can be found at
186    <eref target="http://tools.ietf.org/wg/httpbis/"/>.
187  </t>
188  <t>
189    The changes in this draft are summarized in <xref target="changes.since.16"/>.
190  </t>
191</note>
192</front>
193<middle>
194<section title="Introduction" anchor="introduction">
195<t>
196   HTTP clients often encounter interrupted data transfers as a result
197   of cancelled requests or dropped connections.  When a client has stored
198   a partial representation, it is desirable to request the remainder
199   of that representation in a subsequent request rather than transfer
200   the entire representation.
201   There are also a number of Web applications that benefit from being
202   able to request only a subset of a larger representation, such as a
203   single page of a very large document or only part of an image to be
204   rendered by a device with limited local storage.
205</t>
206<t>
207   This document defines HTTP/1.1 range requests,
208   partial responses, and the multipart/byteranges media type.
209   The protocol for range requests is an OPTIONAL feature of HTTP,
210   designed so resources or recipients that do not implement this feature
211   can respond as if it is a normal GET request without impacting
212   interoperability.  Partial responses are indicated by a distinct status
213   code to not be mistaken for full responses by intermediate caches
214   that might not implement the feature.
215</t>
216<t>
217   Although the HTTP range request mechanism is designed to allow for
218   extensible range types, this specification only defines requests for
219   byte ranges.
220</t>
221
222<section title="Conformance and Error Handling" anchor="intro.conformance.and.error.handling">
223<t>
224   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
225   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
226   document are to be interpreted as described in <xref target="RFC2119"/>.
227</t>
228<t>
229   This document defines conformance criteria for several roles in HTTP
230   communication, including Senders, Recipients, Clients, Servers, User-Agents,
231   Origin Servers, Intermediaries, Proxies and Gateways. See Section 2 of <xref target="Part1"/>
232   for definitions of these terms.
233</t>
234<t>
235   An implementation is considered conformant if it complies with all of the
236   requirements associated with its role(s). Note that SHOULD-level requirements
237   are relevant here, unless one of the documented exceptions is applicable.
238</t>
239<t>
240   This document also uses ABNF to define valid protocol elements
241   (<xref target="notation"/>). In addition to the prose requirements placed
242   upon them, Senders MUST NOT generate protocol elements that are invalid.
243</t>
244<t>
245   Unless noted otherwise, Recipients MAY take steps to recover a usable
246   protocol element from an invalid construct. However, HTTP does not define
247   specific error handling mechanisms, except in cases where it has direct
248   impact on security. This is because different uses of the protocol require
249   different error handling strategies; for example, a Web browser may wish to
250   transparently recover from a response where the Location header field
251   doesn't parse according to the ABNF, whereby in a systems control protocol
252   using HTTP, this type of error recovery could lead to dangerous consequences.
253</t>
254</section>
255
256<section title="Syntax Notation" anchor="notation">
257 
258 
259 
260 
261 
262 
263 
264 
265<t>
266  This specification uses the ABNF syntax defined in Section 1.2 of <xref target="Part1"/> (which
267  extends the syntax defined in <xref target="RFC5234"/> with a list rule).
268  <xref target="collected.abnf"/> shows the collected ABNF, with the list
269  rule expanded.
270</t>
271<t>
272  The following core rules are included by
273  reference, as defined in <xref target="RFC5234"/>, Appendix B.1:
274  ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls),
275  DIGIT (decimal 0-9), DQUOTE (double quote),
276  HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed),
277  OCTET (any 8-bit sequence of data), SP (space), and
278  VCHAR (any visible US-ASCII character).
279</t>
280
281<t>
282  Note that all rules derived from <xref target="core.rules" format="none">token</xref> are to
283  be compared case-insensitively, like <xref target="range.units" format="none">range-unit</xref> and
284  <xref target="header.accept-ranges" format="none">acceptable-ranges</xref>.
285</t>
286
287<section title="Core Rules" anchor="core.rules">
288 
289 
290 
291<t>
292  The core rules below are defined in <xref target="Part1"/> and
293  <xref target="Part2"/>:
294</t>
295<figure><artwork type="abnf2616"><![CDATA[
296  OWS        = <OWS, defined in [Part1], Section 1.2.2>
297  token      = <token, defined in [Part1], Section 3.2.3>
298  HTTP-date  = <HTTP-date, defined in [Part2], Section 8>
299]]></artwork></figure>
300</section>
301
302<section title="ABNF Rules defined in other Parts of the Specification" anchor="abnf.dependencies">
303 
304<t>
305  The ABNF rules below are defined in other parts:
306</t>
307<figure><artwork type="abnf2616"><![CDATA[
308  entity-tag = <entity-tag, defined in [Part4], Section 2.3>
309]]></artwork></figure>
310</section>
311
312</section>
313
314</section>
315
316
317<section title="Range Units" anchor="range.units">
318 
319 
320 
321<t>
322   HTTP/1.1 allows a client to request that only part (a range) of the
323   representation be included within the response. HTTP/1.1 uses range
324   units in the Range (<xref target="header.range"/>) and Content-Range (<xref target="header.content-range"/>)
325   header fields. A representation can be broken down into subranges according
326   to various structural units.
327</t>
328<figure><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"/><artwork type="abnf2616"><![CDATA[
329  range-unit       = bytes-unit / other-range-unit
330  bytes-unit       = "bytes"
331  other-range-unit = token
332]]></artwork></figure>
333<t>
334  HTTP/1.1 has been designed to allow implementations of applications
335  that do not depend on knowledge of ranges. The only range unit defined
336  by HTTP/1.1 is "bytes". Additional specifiers can be defined as described
337  in <xref target="range.specifier.registry"/>.
338</t>
339<t>
340  If a range unit is not understood in a request, a server MUST ignore
341  the whole Range header field (<xref target="header.range"/>).
342  If a range unit is not understood in a response, an intermediary
343  SHOULD pass the response to the client; a client MUST fail.
344</t>
345
346<section title="Range Specifier Registry" anchor="range.specifier.registry">
347<t>
348   The HTTP Range Specifier Registry defines the name space for the range
349   specifier names.
350</t>
351<t>
352   Registrations MUST include the following fields:
353   <list style="symbols">
354     <t>Name</t>
355     <t>Description</t>
356     <t>Pointer to specification text</t>
357   </list>
358</t>
359<t>
360  Values to be added to this name space are subject to IETF review
361  (<xref target="RFC5226"/>, Section 4.1).
362</t>
363<t>
364   The registry itself is maintained at
365   <eref target="http://www.iana.org/assignments/http-range-specifiers"/>.
366</t>
367</section>
368
369</section>
370
371<section title="Status Code Definitions" anchor="status.code.definitions">
372<section title="206 Partial Content" anchor="status.206">
373  <iref primary="true" item="206 Partial Content (status code)"/>
374  <iref primary="true" item="Status Codes" subitem="206 Partial Content"/>
375<t>
376   The server has fulfilled the partial GET request for the resource.
377   The request MUST have included a Range header field (<xref target="header.range"/>)
378   indicating the desired range, and MAY have included an If-Range
379   header field (<xref target="header.if-range"/>) to make the request conditional.
380</t>
381<t>
382   The response MUST include the following header fields:
383  <list style="symbols">
384    <t>
385        Either a Content-Range header field (<xref target="header.content-range"/>) indicating
386        the range included with this response, or a multipart/byteranges
387        Content-Type including Content-Range fields for each part. If a
388        Content-Length header field is present in the response, its
389        value MUST match the actual number of octets transmitted in the
390        message-body.
391    </t>
392    <t>
393        Date
394    </t>
395    <t>
396        Cache-Control, ETag, Expires, Content-Location, Last-Modified,
397        and/or Vary, if the header field would have been sent in a 200
398        response to the same request
399    </t>
400  </list>
401</t>
402<t>
403   If the 206 response is the result of an If-Range request, the response
404   SHOULD NOT include other representation header fields. Otherwise, the response
405   MUST include all of the representation header fields that would have been returned
406   with a 200 (OK) response to the same request.
407</t>
408</section>
409
410<section title="416 Requested Range Not Satisfiable" anchor="status.416">
411  <iref primary="true" item="416 Requested Range Not Satisfiable (status code)"/>
412  <iref primary="true" item="Status Codes" subitem="416 Requested Range Not Satisfiable"/>
413<t>
414   A server SHOULD return a response with this status code if a request
415   included a Range header field (<xref target="header.range"/>), and none of
416   the ranges-specifier values in this field overlap the current extent
417   of the selected resource, and the request did not include an If-Range
418   header field (<xref target="header.if-range"/>). (For byte-ranges,
419   this means that the first-byte-pos of all of the byte-range-spec values were
420   greater than the current length of the selected resource.)
421</t>
422<t>
423   When this status code is returned for a byte-range request, the
424   response SHOULD include a Content-Range header field
425   specifying the current length of the representation (see <xref target="header.content-range"/>).
426   This response MUST NOT use the multipart/byteranges content-type.
427</t>
428</section>
429</section>
430
431<section title="Combining Ranges" anchor="combining.byte.ranges">
432<t>
433   A response might transfer only a subrange of a representation if the
434   connection closed prematurely or if the request used one or more Range
435   specifications.  After several such transfers, a client might have
436   received several ranges of the same representation.  These ranges can only
437   be safely combined if they all have in common the same strong validator,
438   where "strong validator" is defined to be either an entity-tag that is
439   not marked as weak (Section 2.3 of <xref target="Part4"/>) or, if no entity-tag is provided, a
440   Last-Modified value that is strong in the sense defined by
441   Section 2.2.2 of <xref target="Part4"/>.
442</t>
443<t>
444   When a client receives an incomplete 200 (OK) or 206 (Partial Content)
445   response and already has one or more stored responses for the same method
446   and effective request URI, all of the stored responses with the same
447   strong validator MAY be combined with the partial content in this new
448   response.  If none of the stored responses contain the same strong
449   validator, then this new response corresponds to a new representation
450   and MUST NOT be combined with the existing stored responses.
451</t>
452<t>
453   If the new response is an incomplete 200 (OK) response, then the header
454   fields of that new response are used for any combined response and replace
455   those of the matching stored responses.
456</t>
457<t>
458   If the new response is a 206 (Partial Content) response and at least one
459   of the matching stored responses is a 200 (OK), then the combined response
460   header fields consist of the most recent 200 response's header fields.
461   If all of the matching stored responses are 206 responses, then the
462   stored response with the most header fields is used as the source of
463   header fields for the combined response, except that the client MUST
464   use other header fields provided in the new response, aside from
465   Content-Range, to replace all instances of the corresponding header
466   fields in the stored response.
467</t>
468<t>
469   The combined response message-body consists of the union of partial
470   content ranges in the new response and each of the selected responses.
471   If the union consists of the entire range of the representation, then the
472   combined response MUST be recorded as a complete 200 (OK) response
473   with a Content-Length header field that reflects the complete length.
474   Otherwise, the combined response(s) MUST include a Content-Range
475   header field describing the included range(s) and be recorded as
476   incomplete.  If the union consists of a discontinuous range of the
477   representation, then the client MAY store it as either a multipart range
478   response or as multiple 206 responses with one continuous range each.
479</t>
480</section>
481
482<section title="Header Field Definitions" anchor="header.field.definitions">
483<t>
484   This section defines the syntax and semantics of HTTP/1.1 header fields
485   related to range requests and partial responses.
486</t>
487
488<section title="Accept-Ranges" anchor="header.accept-ranges">
489  <iref primary="true" item="Accept-Ranges header field"/>
490  <iref primary="true" item="Header Fields" subitem="Accept-Ranges"/>
491 
492 
493<t>
494   The "Accept-Ranges" header field allows a resource to indicate
495   its acceptance of range requests.
496</t>
497<figure><iref primary="true" item="Grammar" subitem="Accept-Ranges"/><iref primary="true" item="Grammar" subitem="acceptable-ranges"/><artwork type="abnf2616"><![CDATA[
498  Accept-Ranges     = acceptable-ranges
499  acceptable-ranges = 1#range-unit / "none"
500]]></artwork></figure>
501<t>
502      Origin servers that accept byte-range requests MAY send
503</t>
504<figure><artwork type="example"><![CDATA[
505  Accept-Ranges: bytes
506]]></artwork></figure>
507<t>
508      but are not required to do so. Clients MAY generate range
509      requests without having received this header field for the resource
510      involved. Range units are defined in <xref target="range.units"/>.
511</t>
512<t>
513      Servers that do not accept any kind of range request for a
514      resource MAY send
515</t>
516<figure><artwork type="example"><![CDATA[
517  Accept-Ranges: none
518]]></artwork></figure>
519<t>
520      to advise the client not to attempt a range request.
521</t>
522</section>
523
524<section title="Content-Range" anchor="header.content-range">
525  <iref primary="true" item="Content-Range header field"/>
526  <iref primary="true" item="Header Fields" subitem="Content-Range"/>
527 
528 
529 
530 
531 
532 
533<t>
534   The "Content-Range" header field is sent with a partial representation to
535   specify where in the full representation the payload body is intended to be
536   applied.
537</t>
538<t>   
539   Range units are defined in <xref target="range.units"/>.
540</t>
541<figure><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"/><artwork type="abnf2616"><![CDATA[
542  Content-Range           = byte-content-range-spec
543                          / other-content-range-spec
544                         
545  byte-content-range-spec = bytes-unit SP
546                            byte-range-resp-spec "/"
547                            ( instance-length / "*" )
548 
549  byte-range-resp-spec    = (first-byte-pos "-" last-byte-pos)
550                          / "*"
551                         
552  instance-length         = 1*DIGIT
553 
554  other-content-range-spec = other-range-unit SP
555                             other-range-resp-spec
556  other-range-resp-spec    = *CHAR
557]]></artwork></figure>
558<t>
559   The header field SHOULD indicate the total length of the full representation,
560   unless this length is unknown or difficult to determine. The asterisk
561   "*" character means that the instance-length is unknown at the time
562   when the response was generated.
563</t>
564<t>
565   Unlike byte-ranges-specifier values (see <xref target="byte.ranges"/>), a byte-range-resp-spec
566   MUST only specify one range, and MUST contain
567   absolute byte positions for both the first and last byte of the
568   range.
569</t>
570<t>
571   A byte-content-range-spec with a byte-range-resp-spec whose last-byte-pos
572   value is less than its first-byte-pos value, or whose
573   instance-length value is less than or equal to its last-byte-pos
574   value, is invalid. The recipient of an invalid byte-content-range-spec
575   MUST ignore it and any content transferred along with it.
576</t>
577<t>
578   In the case of a byte range request:
579   A server sending a response with status code 416 (Requested range not
580   satisfiable) SHOULD include a Content-Range field with a byte-range-resp-spec
581   of "*". The instance-length specifies the current length of
582   the selected resource. A response with status code 206 (Partial
583   Content) MUST NOT include a Content-Range field with a byte-range-resp-spec of "*".
584</t>
585<t>
586  The "Content-Range" header field has no meaning for status codes that do not
587  explicitly describe its semantic. Currently, only status codes
588  206 (Partial Content) and 416 (Requested range not satisfiable) describe
589  the meaning of this header field.
590</t>
591<t>
592   Examples of byte-content-range-spec values, assuming that the representation
593   contains a total of 1234 bytes:
594   <list style="symbols">
595      <t>
596        The first 500 bytes:
597<figure><artwork type="example"><![CDATA[
598     bytes 0-499/1234
599   ]]></artwork></figure>
600      </t>   
601      <t>
602        The second 500 bytes:
603<figure><artwork type="example"><![CDATA[
604     bytes 500-999/1234
605   ]]></artwork></figure>
606      </t>   
607      <t>
608        All except for the first 500 bytes:
609<figure><artwork type="example"><![CDATA[
610     bytes 500-1233/1234
611   ]]></artwork></figure>
612      </t>   
613      <t>
614        The last 500 bytes:
615<figure><artwork type="example"><![CDATA[
616     bytes 734-1233/1234
617   ]]></artwork></figure>
618      </t>   
619   </list>
620</t>
621<t>
622   When an HTTP message includes the content of a single range (for
623   example, a response to a request for a single range, or to a request
624   for a set of ranges that overlap without any holes), this content is
625   transmitted with a Content-Range header field, and a Content-Length header
626   field showing the number of bytes actually transferred. For example,
627</t>
628<figure><artwork type="example"><![CDATA[
629  HTTP/1.1 206 Partial Content
630  Date: Wed, 15 Nov 1995 06:25:24 GMT
631  Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
632  Content-Range: bytes 21010-47021/47022
633  Content-Length: 26012
634  Content-Type: image/gif
635]]></artwork></figure>
636<t>
637   When an HTTP message includes the content of multiple ranges (for
638   example, a response to a request for multiple non-overlapping
639   ranges), these are transmitted as a multipart message. The multipart
640   media type used for this purpose is "multipart/byteranges" as defined
641   in <xref target="internet.media.type.multipart.byteranges"/>.
642</t>
643<t>
644   A response to a request for a single range MUST NOT be sent using the
645   multipart/byteranges media type.  A response to a request for
646   multiple ranges, whose result is a single range, MAY be sent as a
647   multipart/byteranges media type with one part. A client that cannot
648   decode a multipart/byteranges message MUST NOT ask for multiple
649   ranges in a single request.
650</t>
651<t>
652   When a client requests multiple ranges in one request, the
653   server SHOULD return them in the order that they appeared in the
654   request.
655</t>
656<t>
657   If the server ignores a byte-range-spec because it is syntactically
658   invalid, the server SHOULD treat the request as if the invalid Range
659   header field did not exist. (Normally, this means return a 200
660   response containing the full representation).
661</t>
662<t>
663   If the server receives a request (other than one including an If-Range
664   header field) with an unsatisfiable Range header
665   field (that is, all of whose byte-range-spec values have a
666   first-byte-pos value greater than the current length of the selected
667   resource), it SHOULD return a response code of 416 (Requested range
668   not satisfiable) (<xref target="status.416"/>).
669</t>
670<t><list>
671  <t>
672    Note: Clients cannot depend on servers to send a 416 (Requested
673    range not satisfiable) response instead of a 200 (OK) response for
674    an unsatisfiable Range header field, since not all servers
675    implement this header field.
676  </t>
677</list></t>
678</section>
679
680<section title="If-Range" anchor="header.if-range">
681  <iref primary="true" item="If-Range header field"/>
682  <iref primary="true" item="Header Fields" subitem="If-Range"/>
683 
684<t>
685   If a client has a partial copy of a representation and wishes
686   to have an up-to-date copy of the entire representation, it
687   could use the Range header field with a conditional GET (using
688   either or both of If-Unmodified-Since and If-Match.) However, if the
689   condition fails because the representation has been modified, the client
690   would then have to make a second request to obtain the entire current
691   representation.
692</t>
693<t>
694   The "If-Range" header field allows a client to "short-circuit" the second
695   request. Informally, its meaning is "if the representation is unchanged, send
696   me the part(s) that I am missing; otherwise, send me the entire new
697   representation".
698</t>
699<figure><iref primary="true" item="Grammar" subitem="If-Range"/><artwork type="abnf2616"><![CDATA[
700  If-Range = entity-tag / HTTP-date
701]]></artwork></figure>
702<t>
703   Clients MUST NOT use an entity-tag marked as weak in an If-Range
704   field value and MUST NOT use a Last-Modified date in an If-Range
705   field value unless it has no entity-tag for the representation and
706   the Last-Modified date it does have for the representation is strong
707   in the sense defined by Section 2.2.2 of <xref target="Part4"/>.
708</t>
709<t>
710   A server that evaluates a conditional range request that is applicable
711   to one of its representations MUST evaluate the condition as false if
712   the entity-tag used as a validator is marked as weak or, when an HTTP-date
713   is used as the validator, if the date value is not strong in the sense
714   defined by Section 2.2.2 of <xref target="Part4"/>. (A server can distinguish between a
715   valid HTTP-date and any form of entity-tag by examining the first
716   two characters.)
717</t>
718<t>
719   The If-Range header field SHOULD only be sent by clients together with
720   a Range header field.  The If-Range header field MUST be ignored if it
721   is received in a request that does not include a Range header field.
722   The If-Range header field MUST be ignored by a server that does not
723   support the sub-range operation.
724</t>
725<t>
726   If the validator given in the If-Range header field matches the current
727   validator for the selected representation of the target resource, then
728   the server SHOULD send the specified sub-range of the representation
729   using a 206 (Partial Content) response. If the validator does not match,
730   then the server SHOULD send the entire representation using a 200 (OK)
731   response.
732</t>
733</section>
734
735<section title="Range" anchor="header.range">
736  <iref primary="true" item="Range header field"/>
737  <iref primary="true" item="Header Fields" subitem="Range"/>
738
739<section title="Byte Ranges" anchor="byte.ranges">
740<t>
741   Since all HTTP representations are transferred as sequences
742   of bytes, the concept of a byte range is meaningful for any HTTP
743   representation. (However, not all clients and servers need to support byte-range
744   operations.)
745</t>
746<t>
747   Byte range specifications in HTTP apply to the sequence of bytes in
748   the representation body (not necessarily the same as the message-body).
749</t>
750<t anchor="rule.ranges-specifier">
751 
752 
753 
754 
755 
756 
757 
758 
759
760   A byte range operation MAY specify a single range of bytes, or a set
761   of ranges within a single representation.
762</t>
763<figure><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"/><artwork type="abnf2616"><![CDATA[
764  byte-ranges-specifier = bytes-unit "=" byte-range-set
765  byte-range-set  = 1#( byte-range-spec / suffix-byte-range-spec )
766  byte-range-spec = first-byte-pos "-" [ last-byte-pos ]
767  first-byte-pos  = 1*DIGIT
768  last-byte-pos   = 1*DIGIT
769]]></artwork></figure>
770<t>
771   The first-byte-pos value in a byte-range-spec gives the byte-offset
772   of the first byte in a range. The last-byte-pos value gives the
773   byte-offset of the last byte in the range; that is, the byte
774   positions specified are inclusive. Byte offsets start at zero.
775</t>
776<t>
777   If the last-byte-pos value is present, it MUST be greater than or
778   equal to the first-byte-pos in that byte-range-spec, or the byte-range-spec
779   is syntactically invalid. The recipient of a byte-range-set
780   that includes one or more syntactically invalid byte-range-spec
781   values MUST ignore the header field that includes that byte-range-set.
782</t>
783<t>
784   If the last-byte-pos value is absent, or if the value is greater than
785   or equal to the current length of the representation body, last-byte-pos is
786   taken to be equal to one less than the current length of the representation
787   in bytes.
788</t>
789<t>
790   By its choice of last-byte-pos, a client can limit the number of
791   bytes retrieved without knowing the size of the representation.
792</t>
793<figure><iref primary="true" item="Grammar" subitem="suffix-byte-range-spec"/><iref primary="true" item="Grammar" subitem="suffix-length"/><artwork type="abnf2616"><![CDATA[
794  suffix-byte-range-spec = "-" suffix-length
795  suffix-length = 1*DIGIT
796]]></artwork></figure>
797<t>
798   A suffix-byte-range-spec is used to specify the suffix of the
799   representation body, of a length given by the suffix-length value. (That is,
800   this form specifies the last N bytes of a representation.) If the
801   representation is shorter than the specified suffix-length, the entire
802   representation is used.
803</t>
804<t>
805   If a syntactically valid byte-range-set includes at least one byte-range-spec
806   whose first-byte-pos is less than the current length of
807   the representation, or at least one suffix-byte-range-spec with a non-zero
808   suffix-length, then the byte-range-set is satisfiable.
809   Otherwise, the byte-range-set is unsatisfiable. If the byte-range-set
810   is unsatisfiable, the server SHOULD return a response with a
811   416 (Requested range not satisfiable) status code. Otherwise, the server
812   SHOULD return a response with a 206 (Partial Content) status code
813   containing the satisfiable ranges of the representation.
814</t>
815<t>
816   Examples of byte-ranges-specifier values (assuming a representation of
817   length 10000):
818  <list style="symbols">
819     <t>The first 500 bytes (byte offsets 0-499, inclusive):
820<figure><artwork type="example"><![CDATA[
821     bytes=0-499
822   ]]></artwork></figure>
823    </t>
824     <t>The second 500 bytes (byte offsets 500-999, inclusive):
825<figure><artwork type="example"><![CDATA[
826     bytes=500-999
827   ]]></artwork></figure>
828    </t>
829     <t>The final 500 bytes (byte offsets 9500-9999, inclusive):
830<figure><artwork type="example"><![CDATA[
831     bytes=-500
832   ]]></artwork></figure>
833    Or:
834<figure><artwork type="example"><![CDATA[
835     bytes=9500-
836   ]]></artwork></figure>
837    </t>
838     <t>The first and last bytes only (bytes 0 and 9999):
839<figure><artwork type="example"><![CDATA[
840     bytes=0-0,-1
841   ]]></artwork></figure>
842     </t>
843     <t>Several legal but not canonical specifications of the second 500
844        bytes (byte offsets 500-999, inclusive):
845<figure><artwork type="example"><![CDATA[
846     bytes=500-600,601-999
847     bytes=500-700,601-999
848   ]]></artwork></figure>
849     </t>
850  </list>
851</t>
852</section>
853
854<section title="Range Retrieval Requests" anchor="range.retrieval.requests">
855 
856 
857 
858<t>
859   The "Range" header field defines the GET method (conditional or
860   not) to request one or more sub-ranges of the response representation body, instead
861   of the entire representation body.
862</t>
863<figure><iref primary="true" item="Grammar" subitem="Range"/><artwork type="abnf2616"><![CDATA[
864  Range = byte-ranges-specifier / other-ranges-specifier
865  other-ranges-specifier = other-range-unit "=" other-range-set
866  other-range-set = 1*CHAR
867]]></artwork></figure>
868<t>
869   A server MAY ignore the Range header field. However, origin
870   servers and intermediate caches ought to support byte ranges when
871   possible, since Range supports efficient recovery from partially
872   failed transfers, and supports efficient partial retrieval of large
873   representations.
874</t>
875<t>
876   If the server supports the Range header field and the specified range or
877   ranges are appropriate for the representation:
878  <list style="symbols">
879     <t>The presence of a Range header field in an unconditional GET modifies
880        what is returned if the GET is otherwise successful. In other
881        words, the response carries a status code of 206 (Partial
882        Content) instead of 200 (OK).</t>
883
884     <t>The presence of a Range header field in a conditional GET (a request
885        using one or both of If-Modified-Since and If-None-Match, or
886        one or both of If-Unmodified-Since and If-Match) modifies what
887        is returned if the GET is otherwise successful and the
888        condition is true. It does not affect the 304 (Not Modified)
889        response returned if the conditional is false.</t>
890  </list>
891</t>
892<t>
893   In some cases, it might be more appropriate to use the If-Range
894   header field (see <xref target="header.if-range"/>) in addition to the Range
895   header field.
896</t>
897<t>
898   If a proxy that supports ranges receives a Range request, forwards
899   the request to an inbound server, and receives an entire representation in
900   reply, it MAY only return the requested range to its client.
901</t>
902</section>
903</section>
904</section>
905
906<section title="IANA Considerations" anchor="IANA.considerations">
907
908<section title="Status Code Registration" anchor="status.code.registration">
909<t>
910   The HTTP Status Code Registry located at <eref target="http://www.iana.org/assignments/http-status-codes"/>
911   shall be updated with the registrations below:
912</t>
913
914<!--AUTOGENERATED FROM extract-status-code-defs.xslt, do not edit manually-->
915<texttable align="left" suppress-title="true" anchor="iana.status.code.registration.table">
916   <ttcol>Value</ttcol>
917   <ttcol>Description</ttcol>
918   <ttcol>Reference</ttcol>
919   <c>206</c>
920   <c>Partial Content</c>
921   <c>
922      <xref target="status.206"/>
923   </c>
924   <c>416</c>
925   <c>Requested Range Not Satisfiable</c>
926   <c>
927      <xref target="status.416"/>
928   </c>
929</texttable>
930<!--(END)-->
931
932</section>
933
934<section title="Header Field Registration" anchor="header.field.registration">
935<t>
936   The Message Header Field Registry located at <eref target="http://www.iana.org/assignments/message-headers/message-header-index.html"/> shall be updated
937   with the permanent registrations below (see <xref target="RFC3864"/>):
938</t>
939
940<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
941<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
942   <ttcol>Header Field Name</ttcol>
943   <ttcol>Protocol</ttcol>
944   <ttcol>Status</ttcol>
945   <ttcol>Reference</ttcol>
946
947   <c>Accept-Ranges</c>
948   <c>http</c>
949   <c>standard</c>
950   <c>
951      <xref target="header.accept-ranges"/>
952   </c>
953   <c>Content-Range</c>
954   <c>http</c>
955   <c>standard</c>
956   <c>
957      <xref target="header.content-range"/>
958   </c>
959   <c>If-Range</c>
960   <c>http</c>
961   <c>standard</c>
962   <c>
963      <xref target="header.if-range"/>
964   </c>
965   <c>Range</c>
966   <c>http</c>
967   <c>standard</c>
968   <c>
969      <xref target="header.range"/>
970   </c>
971</texttable>
972<!--(END)-->
973
974<t>
975   The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".
976</t>
977</section>
978
979<section title="Range Specifier Registration" anchor="range.specifier.registration">
980<t>
981  The registration procedure for HTTP Range Specifiers is defined by
982  <xref target="range.specifier.registry"/> of this document.
983</t>
984<t>
985   The HTTP Range Specifier Registry shall be created at <eref target="http://www.iana.org/assignments/http-range-specifiers"/>
986   and be populated with the registrations below:
987</t>
988<texttable align="left" suppress-title="true" anchor="iana.range.specifiers.table">
989   <ttcol>Range Specifier Name</ttcol>
990   <ttcol>Description</ttcol>
991   <ttcol>Reference</ttcol>
992
993   <c>bytes</c>
994   <c>a range of octets</c>
995   <c>(this specification)</c>
996</texttable>
997<t>
998   The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".
999</t>
1000</section>
1001</section>
1002
1003<section title="Security Considerations" anchor="security.considerations">
1004<t>
1005   This section is meant to inform application developers, information
1006   providers, and users of the security limitations in HTTP/1.1 as
1007   described by this document. The discussion does not include
1008   definitive solutions to the problems revealed, though it does make
1009   some suggestions for reducing security risks.
1010</t>
1011<section title="Overlapping Ranges" anchor="overlapping.ranges">
1012<t>
1013   Range requests containing overlapping ranges may lead to the situation
1014   where a server is sending far more data than the size of the complete
1015   resource representation.
1016</t>
1017</section>
1018</section>
1019
1020<section title="Acknowledgments" anchor="acks">
1021<t>
1022  See Section 11 of <xref target="Part1"/>.
1023</t>
1024</section>
1025</middle>
1026<back>
1027
1028<references title="Normative References">
1029
1030<reference anchor="Part1">
1031  <front>
1032    <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title>
1033    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1034      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
1035      <address><email>fielding@gbiv.com</email></address>
1036    </author>
1037    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1038      <organization abbrev="Alcatel-Lucent">Alcatel-Lucent Bell Labs</organization>
1039      <address><email>jg@freedesktop.org</email></address>
1040    </author>
1041    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1042      <organization abbrev="HP">Hewlett-Packard Company</organization>
1043      <address><email>JeffMogul@acm.org</email></address>
1044    </author>
1045    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1046      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1047      <address><email>henrikn@microsoft.com</email></address>
1048    </author>
1049    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1050      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
1051      <address><email>LMM@acm.org</email></address>
1052    </author>
1053    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1054      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1055      <address><email>paulle@microsoft.com</email></address>
1056    </author>
1057    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1058      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1059      <address><email>timbl@w3.org</email></address>
1060    </author>
1061    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1062      <organization abbrev="W3C">World Wide Web Consortium</organization>
1063      <address><email>ylafon@w3.org</email></address>
1064    </author>
1065    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1066      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1067      <address><email>julian.reschke@greenbytes.de</email></address>
1068    </author>
1069    <date month="October" year="2011"/>
1070  </front>
1071  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-17"/>
1072 
1073</reference>
1074
1075<reference anchor="Part2">
1076  <front>
1077    <title abbrev="HTTP/1.1">HTTP/1.1, part 2: Message Semantics</title>
1078    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1079      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
1080      <address><email>fielding@gbiv.com</email></address>
1081    </author>
1082    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1083      <organization abbrev="Alcatel-Lucent">Alcatel-Lucent Bell Labs</organization>
1084      <address><email>jg@freedesktop.org</email></address>
1085    </author>
1086    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1087      <organization abbrev="HP">Hewlett-Packard Company</organization>
1088      <address><email>JeffMogul@acm.org</email></address>
1089    </author>
1090    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1091      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1092      <address><email>henrikn@microsoft.com</email></address>
1093    </author>
1094    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1095      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
1096      <address><email>LMM@acm.org</email></address>
1097    </author>
1098    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1099      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1100      <address><email>paulle@microsoft.com</email></address>
1101    </author>
1102    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1103      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1104      <address><email>timbl@w3.org</email></address>
1105    </author>
1106    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1107      <organization abbrev="W3C">World Wide Web Consortium</organization>
1108      <address><email>ylafon@w3.org</email></address>
1109    </author>
1110    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1111      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1112      <address><email>julian.reschke@greenbytes.de</email></address>
1113    </author>
1114    <date month="October" year="2011"/>
1115  </front>
1116  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-17"/>
1117 
1118</reference>
1119
1120<reference anchor="Part4">
1121  <front>
1122    <title abbrev="HTTP/1.1">HTTP/1.1, part 4: Conditional Requests</title>
1123    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1124      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
1125      <address><email>fielding@gbiv.com</email></address>
1126    </author>
1127    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1128      <organization abbrev="Alcatel-Lucent">Alcatel-Lucent Bell Labs</organization>
1129      <address><email>jg@freedesktop.org</email></address>
1130    </author>
1131    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1132      <organization abbrev="HP">Hewlett-Packard Company</organization>
1133      <address><email>JeffMogul@acm.org</email></address>
1134    </author>
1135    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1136      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1137      <address><email>henrikn@microsoft.com</email></address>
1138    </author>
1139    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1140      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
1141      <address><email>LMM@acm.org</email></address>
1142    </author>
1143    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1144      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1145      <address><email>paulle@microsoft.com</email></address>
1146    </author>
1147    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1148      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1149      <address><email>timbl@w3.org</email></address>
1150    </author>
1151    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1152      <organization abbrev="W3C">World Wide Web Consortium</organization>
1153      <address><email>ylafon@w3.org</email></address>
1154    </author>
1155    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1156      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1157      <address><email>julian.reschke@greenbytes.de</email></address>
1158    </author>
1159    <date month="October" year="2011"/>
1160  </front>
1161  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-17"/>
1162 
1163</reference>
1164
1165<reference anchor="RFC2046">
1166  <front>
1167    <title abbrev="Media Types">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</title>
1168    <author initials="N." surname="Freed" fullname="Ned Freed">
1169      <organization>Innosoft International, Inc.</organization>
1170      <address><email>ned@innosoft.com</email></address>
1171    </author>
1172    <author initials="N." surname="Borenstein" fullname="Nathaniel S. Borenstein">
1173      <organization>First Virtual Holdings</organization>
1174      <address><email>nsb@nsb.fv.com</email></address>
1175    </author>
1176    <date month="November" year="1996"/>
1177  </front>
1178  <seriesInfo name="RFC" value="2046"/>
1179</reference>
1180
1181<reference anchor="RFC2119">
1182  <front>
1183    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
1184    <author initials="S." surname="Bradner" fullname="Scott Bradner">
1185      <organization>Harvard University</organization>
1186      <address><email>sob@harvard.edu</email></address>
1187    </author>
1188    <date month="March" year="1997"/>
1189  </front>
1190  <seriesInfo name="BCP" value="14"/>
1191  <seriesInfo name="RFC" value="2119"/>
1192</reference>
1193
1194<reference anchor="RFC5234">
1195  <front>
1196    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
1197    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
1198      <organization>Brandenburg InternetWorking</organization>
1199      <address>
1200        <email>dcrocker@bbiw.net</email>
1201      </address> 
1202    </author>
1203    <author initials="P." surname="Overell" fullname="Paul Overell">
1204      <organization>THUS plc.</organization>
1205      <address>
1206        <email>paul.overell@thus.net</email>
1207      </address>
1208    </author>
1209    <date month="January" year="2008"/>
1210  </front>
1211  <seriesInfo name="STD" value="68"/>
1212  <seriesInfo name="RFC" value="5234"/>
1213</reference>
1214
1215</references>
1216
1217<references title="Informative References">
1218
1219<reference anchor="RFC2616">
1220  <front>
1221    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
1222    <author initials="R." surname="Fielding" fullname="R. Fielding">
1223      <organization>University of California, Irvine</organization>
1224      <address><email>fielding@ics.uci.edu</email></address>
1225    </author>
1226    <author initials="J." surname="Gettys" fullname="J. Gettys">
1227      <organization>W3C</organization>
1228      <address><email>jg@w3.org</email></address>
1229    </author>
1230    <author initials="J." surname="Mogul" fullname="J. Mogul">
1231      <organization>Compaq Computer Corporation</organization>
1232      <address><email>mogul@wrl.dec.com</email></address>
1233    </author>
1234    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
1235      <organization>MIT Laboratory for Computer Science</organization>
1236      <address><email>frystyk@w3.org</email></address>
1237    </author>
1238    <author initials="L." surname="Masinter" fullname="L. Masinter">
1239      <organization>Xerox Corporation</organization>
1240      <address><email>masinter@parc.xerox.com</email></address>
1241    </author>
1242    <author initials="P." surname="Leach" fullname="P. Leach">
1243      <organization>Microsoft Corporation</organization>
1244      <address><email>paulle@microsoft.com</email></address>
1245    </author>
1246    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
1247      <organization>W3C</organization>
1248      <address><email>timbl@w3.org</email></address>
1249    </author>
1250    <date month="June" year="1999"/>
1251  </front>
1252  <seriesInfo name="RFC" value="2616"/>
1253</reference>
1254
1255<reference anchor="RFC3864">
1256  <front>
1257    <title>Registration Procedures for Message Header Fields</title>
1258    <author initials="G." surname="Klyne" fullname="G. Klyne">
1259      <organization>Nine by Nine</organization>
1260      <address><email>GK-IETF@ninebynine.org</email></address>
1261    </author>
1262    <author initials="M." surname="Nottingham" fullname="M. Nottingham">
1263      <organization>BEA Systems</organization>
1264      <address><email>mnot@pobox.com</email></address>
1265    </author>
1266    <author initials="J." surname="Mogul" fullname="J. Mogul">
1267      <organization>HP Labs</organization>
1268      <address><email>JeffMogul@acm.org</email></address>
1269    </author>
1270    <date year="2004" month="September"/>
1271  </front>
1272  <seriesInfo name="BCP" value="90"/>
1273  <seriesInfo name="RFC" value="3864"/>
1274</reference>
1275
1276<reference anchor="RFC4288">
1277  <front>
1278    <title>Media Type Specifications and Registration Procedures</title>
1279    <author initials="N." surname="Freed" fullname="N. Freed">
1280      <organization>Sun Microsystems</organization>
1281      <address>
1282        <email>ned.freed@mrochek.com</email>
1283      </address>
1284    </author>
1285    <author initials="J." surname="Klensin" fullname="J. Klensin">
1286      <address>
1287        <email>klensin+ietf@jck.com</email>
1288      </address>
1289    </author>
1290    <date year="2005" month="December"/>
1291  </front>
1292  <seriesInfo name="BCP" value="13"/>
1293  <seriesInfo name="RFC" value="4288"/>
1294</reference>
1295
1296<reference anchor="RFC5226">
1297  <front>
1298    <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
1299    <author initials="T." surname="Narten" fullname="T. Narten">
1300      <organization>IBM</organization>
1301      <address><email>narten@us.ibm.com</email></address>
1302    </author>
1303    <author initials="H." surname="Alvestrand" fullname="H. Alvestrand">
1304      <organization>Google</organization>
1305      <address><email>Harald@Alvestrand.no</email></address>
1306    </author>
1307    <date year="2008" month="May"/>
1308  </front>
1309  <seriesInfo name="BCP" value="26"/>
1310  <seriesInfo name="RFC" value="5226"/>
1311</reference>
1312
1313</references>
1314
1315<section title="Internet Media Type multipart/byteranges" anchor="internet.media.type.multipart.byteranges">
1316<iref item="Media Type" subitem="multipart/byteranges" primary="true"/>
1317<iref item="multipart/byteranges Media Type" primary="true"/>
1318<t>
1319   When an HTTP 206 (Partial Content) response message includes the
1320   content of multiple ranges (a response to a request for multiple
1321   non-overlapping ranges), these are transmitted as a multipart
1322   message-body (<xref target="RFC2046"/>, Section 5.1). The media type for this purpose is called
1323   "multipart/byteranges".  The following is to be registered with IANA <xref target="RFC4288"/>.
1324</t>
1325<t><list>
1326  <t>
1327    Note: Despite the name "multipart/byteranges" is not limited to the byte ranges only.
1328  </t>
1329</list></t>
1330<t>
1331   The multipart/byteranges media type includes one or more parts, each
1332   with its own Content-Type and Content-Range fields. The required
1333   boundary parameter specifies the boundary string used to separate
1334   each body-part.
1335</t>
1336<t>
1337  <list style="hanging">
1338    <t hangText="Type name:">
1339      multipart
1340    </t>
1341    <t hangText="Subtype name:">
1342      byteranges
1343    </t>
1344    <t hangText="Required parameters:">
1345      boundary
1346    </t>
1347    <t hangText="Optional parameters:">
1348      none
1349    </t>
1350    <t hangText="Encoding considerations:">
1351      only "7bit", "8bit", or "binary" are permitted
1352    </t>
1353    <t hangText="Security considerations:">
1354      none
1355    </t>
1356    <t hangText="Interoperability considerations:">
1357      none
1358    </t>
1359    <t hangText="Published specification:">
1360      This specification (see <xref target="internet.media.type.multipart.byteranges"/>).
1361    </t>
1362    <t hangText="Applications that use this media type:">
1363    </t>
1364    <t hangText="Additional information:">
1365      <list style="hanging">
1366        <t hangText="Magic number(s):">none</t>
1367        <t hangText="File extension(s):">none</t>
1368        <t hangText="Macintosh file type code(s):">none</t>
1369      </list>
1370    </t>
1371    <t hangText="Person and email address to contact for further information:">
1372      See Authors Section.
1373    </t>
1374    <t hangText="Intended usage:">
1375      COMMON
1376    </t>
1377    <t hangText="Restrictions on usage:">
1378      none
1379    </t>
1380    <t hangText="Author/Change controller:">
1381      IESG
1382    </t>
1383  </list>
1384</t>
1385<figure><preamble>
1386   For example:
1387</preamble><artwork type="example"><![CDATA[
1388  HTTP/1.1 206 Partial Content
1389  Date: Wed, 15 Nov 1995 06:25:24 GMT
1390  Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
1391  Content-type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
1392 
1393  --THIS_STRING_SEPARATES
1394  Content-type: application/pdf
1395  Content-range: bytes 500-999/8000
1396 
1397  ...the first range...
1398  --THIS_STRING_SEPARATES
1399  Content-type: application/pdf
1400  Content-range: bytes 7000-7999/8000
1401 
1402  ...the second range
1403  --THIS_STRING_SEPARATES--
1404]]></artwork></figure>
1405<figure><preamble>
1406   Other example:
1407</preamble>
1408<artwork type="example"><![CDATA[
1409  HTTP/1.1 206 Partial Content
1410  Date: Tue, 14 Nov 1995 06:25:24 GMT
1411  Last-Modified: Tue, 14 July 04:58:08 GMT
1412  Content-type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
1413 
1414  --THIS_STRING_SEPARATES
1415  Content-type: video/example
1416  Content-range: exampleunit 1.2-4.3/25
1417 
1418  ...the first range...
1419  --THIS_STRING_SEPARATES
1420  Content-type: video/example
1421  Content-range: exampleunit 11.2-14.3/25
1422 
1423  ...the second range
1424  --THIS_STRING_SEPARATES--
1425]]></artwork>
1426</figure>
1427<t>
1428      Notes:
1429  <list style="numbers">
1430      <t>Additional CRLFs MAY precede the first boundary string in the body.</t>
1431
1432      <t>Although <xref target="RFC2046"/> permits the boundary string to be
1433         quoted, some existing implementations handle a quoted boundary
1434         string incorrectly.</t>
1435
1436      <t>A number of browsers and servers were coded to an early draft
1437         of the byteranges specification to use a media type of
1438         multipart/x-byteranges<iref item="multipart/x-byteranges Media Type"/><iref item="Media Type" subitem="multipart/x-byteranges"/>, which is almost, but not quite
1439         compatible with the version documented in HTTP/1.1.</t>
1440  </list>
1441</t>
1442</section>
1443
1444<section title="Compatibility with Previous Versions" anchor="compatibility">
1445<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
1446<t>
1447  Clarify that it is not ok to use a weak validator in a 206 response.
1448  (<xref target="status.206"/>)
1449</t>
1450<t>
1451  Change ABNF productions for header fields to only define the field value.
1452  (<xref target="header.field.definitions"/>)
1453</t>
1454<t>
1455  Clarify that multipart/byteranges can consist of a single part.
1456  (<xref target="internet.media.type.multipart.byteranges"/>)
1457</t>
1458</section>
1459
1460</section>
1461
1462
1463<section title="Collected ABNF" anchor="collected.abnf">
1464<figure>
1465<artwork type="abnf" name="p5-range.parsed-abnf"><![CDATA[
1466Accept-Ranges = acceptable-ranges
1467
1468Content-Range = byte-content-range-spec / other-content-range-spec
1469
1470HTTP-date = <HTTP-date, defined in [Part2], Section 8>
1471
1472If-Range = entity-tag / HTTP-date
1473
1474OWS = <OWS, defined in [Part1], Section 1.2.2>
1475
1476Range = byte-ranges-specifier / other-ranges-specifier
1477
1478acceptable-ranges = ( *( "," OWS ) range-unit *( OWS "," [ OWS
1479 range-unit ] ) ) / "none"
1480
1481byte-content-range-spec = bytes-unit SP byte-range-resp-spec "/" (
1482 instance-length / "*" )
1483byte-range-resp-spec = ( first-byte-pos "-" last-byte-pos ) / "*"
1484byte-range-set = ( *( "," OWS ) byte-range-spec ) / (
1485 suffix-byte-range-spec *( OWS "," [ ( OWS byte-range-spec ) /
1486 suffix-byte-range-spec ] ) )
1487byte-range-spec = first-byte-pos "-" [ last-byte-pos ]
1488byte-ranges-specifier = bytes-unit "=" byte-range-set
1489bytes-unit = "bytes"
1490
1491entity-tag = <entity-tag, defined in [Part4], Section 2.3>
1492
1493first-byte-pos = 1*DIGIT
1494
1495instance-length = 1*DIGIT
1496
1497last-byte-pos = 1*DIGIT
1498
1499other-content-range-spec = other-range-unit SP other-range-resp-spec
1500other-range-resp-spec = *CHAR
1501other-range-set = 1*CHAR
1502other-range-unit = token
1503other-ranges-specifier = other-range-unit "=" other-range-set
1504
1505range-unit = bytes-unit / other-range-unit
1506
1507suffix-byte-range-spec = "-" suffix-length
1508suffix-length = 1*DIGIT
1509
1510token = <token, defined in [Part1], Section 3.2.3>
1511]]></artwork>
1512</figure>
1513<figure><preamble>ABNF diagnostics:</preamble><artwork type="inline"><![CDATA[
1514; Accept-Ranges defined but not used
1515; Content-Range defined but not used
1516; If-Range defined but not used
1517; Range defined but not used
1518]]></artwork></figure></section>
1519
1520
1521
1522<section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
1523
1524<section title="Since RFC 2616">
1525<t>
1526  Extracted relevant partitions from <xref target="RFC2616"/>.
1527</t>
1528</section>
1529
1530<section title="Since draft-ietf-httpbis-p5-range-00">
1531<t>
1532  Closed issues:
1533  <list style="symbols"> 
1534    <t>
1535      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/18"/>:
1536      "Cache validators in 206 responses"
1537      (<eref target="http://purl.org/NET/http-errata#ifrange206"/>)
1538    </t>
1539    <t>
1540      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/35"/>:
1541      "Normative and Informative references"
1542    </t>
1543    <t>
1544      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/86"/>:
1545      "Normative up-to-date references"
1546    </t>
1547  </list>
1548</t>
1549</section>
1550
1551<section title="Since draft-ietf-httpbis-p5-range-01">
1552<t>
1553  Closed issues:
1554  <list style="symbols"> 
1555    <t>
1556      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/55"/>:
1557      "Updating to RFC4288"
1558    </t>
1559  </list>
1560</t>
1561<t>
1562  Ongoing work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>):
1563  <list style="symbols"> 
1564    <t>
1565      Add explicit references to BNF syntax and rules imported from other parts of the specification.
1566    </t>
1567  </list>
1568</t>
1569</section>
1570
1571<section title="Since draft-ietf-httpbis-p5-range-02" anchor="changes.since.02">
1572<t>
1573  Ongoing work on IANA Message Header Field Registration (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/40"/>):
1574  <list style="symbols"> 
1575    <t>
1576      Reference RFC 3984, and update header field registrations for headers defined
1577      in this document.
1578    </t>
1579  </list>
1580</t>
1581</section>
1582
1583<section title="Since draft-ietf-httpbis-p5-range-03" anchor="changes.since.03">
1584<t>
1585  None.
1586</t>
1587</section>
1588
1589<section title="Since draft-ietf-httpbis-p5-range-04" anchor="changes.since.04">
1590<t>
1591  Closed issues:
1592  <list style="symbols"> 
1593    <t>
1594      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/133"/>:
1595      "multipart/byteranges minimum number of parts"
1596    </t>
1597  </list>
1598</t>
1599<t>
1600  Ongoing work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>):
1601  <list style="symbols"> 
1602    <t>
1603      Use "/" instead of "|" for alternatives.
1604    </t>
1605    <t>
1606      Introduce new ABNF rules for "bad" whitespace ("BWS"), optional
1607      whitespace ("OWS") and required whitespace ("RWS").
1608    </t>
1609    <t>
1610      Rewrite ABNFs to spell out whitespace rules, factor out
1611      header field value format definitions.
1612    </t>
1613  </list>
1614</t>
1615</section>
1616
1617<section title="Since draft-ietf-httpbis-p5-range-05" anchor="changes.since.05">
1618<t>
1619  Closed issues:
1620  <list style="symbols"> 
1621    <t>
1622      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/142"/>:
1623      "State base for *-byte-pos and suffix-length"
1624    </t>
1625  </list>
1626</t>
1627<t>
1628  Ongoing work on Custom Ranges (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/85"/>):
1629  <list style="symbols"> 
1630    <t>
1631      Remove bias in favor of byte ranges; allow custom ranges in ABNF.
1632    </t>
1633  </list>
1634</t>
1635<t>
1636  Final work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>):
1637  <list style="symbols"> 
1638    <t>
1639      Add appendix containing collected and expanded ABNF, reorganize ABNF introduction.
1640    </t>
1641  </list>
1642</t>
1643</section>
1644
1645<section title="Since draft-ietf-httpbis-p5-range-06" anchor="changes.since.06">
1646<t>
1647  Closed issues:
1648  <list style="symbols"> 
1649    <t>
1650      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/161"/>:
1651      "base for numeric protocol elements"
1652    </t>
1653  </list>
1654</t>
1655</section>
1656
1657<section title="Since draft-ietf-httpbis-p5-range-07" anchor="changes.since.07">
1658<t>
1659  Closed issues:
1660  <list style="symbols">
1661    <t>
1662      Fixed discrepancy in the If-Range definition about allowed validators.
1663    </t>
1664    <t>
1665      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/150"/>: "multipart/byteranges for custom range units"
1666    </t>
1667    <t>
1668      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/151"/>: "range unit missing from other-ranges-specifier in Range header"
1669    </t>
1670    <t>
1671      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/198"/>:
1672      "move IANA registrations for optional status codes"
1673    </t>
1674  </list>
1675</t>
1676</section>
1677
1678<section title="Since draft-ietf-httpbis-p5-range-08" anchor="changes.since.08">
1679<t>
1680  No significant changes.
1681</t>
1682</section>
1683
1684<section title="Since draft-ietf-httpbis-p5-range-09" anchor="changes.since.09">
1685<t>
1686 No significant changes.
1687</t>
1688</section>
1689
1690<section title="Since draft-ietf-httpbis-p5-range-10" anchor="changes.since.10">
1691<t>
1692  Closed issues:
1693  <list style="symbols"> 
1694    <t>
1695      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/69"/>:
1696      "Clarify 'Requested Variant'"
1697    </t>
1698    <t>
1699      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/109"/>:
1700      "Clarify entity / representation / variant terminology"
1701    </t>
1702    <t>
1703      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/220"/>:
1704      "consider removing the 'changes from 2068' sections"
1705    </t>
1706  </list>
1707</t>
1708<t>
1709  Ongoing work on Custom Ranges (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/85"/>):
1710  <list style="symbols"> 
1711    <t>
1712      Add IANA registry.
1713    </t>
1714  </list>
1715</t>
1716</section>
1717
1718<section title="Since draft-ietf-httpbis-p5-range-11" anchor="changes.since.11">
1719<t>
1720  Closed issues:
1721  <list style="symbols"> 
1722    <t>
1723      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/217"/>:
1724      "Caches can't be required to serve ranges"
1725    </t>
1726  </list>
1727</t>
1728</section>
1729
1730<section title="Since draft-ietf-httpbis-p5-range-12" anchor="changes.since.12">
1731<t>
1732  Closed issues:
1733  <list style="symbols"> 
1734    <t>
1735      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/224"/>:
1736      "Header Classification"
1737    </t>
1738  </list>
1739</t>
1740</section>
1741
1742<section title="Since draft-ietf-httpbis-p5-range-13" anchor="changes.since.13">
1743<t>
1744  Closed issues:
1745  <list style="symbols">
1746    <t>
1747      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/276"/>:
1748      "untangle ABNFs for header fields"
1749    </t>
1750  </list>
1751</t>
1752</section>
1753
1754<section title="Since draft-ietf-httpbis-p5-range-14" anchor="changes.since.14">
1755<t>
1756  None.
1757</t>
1758</section>
1759
1760<section title="Since draft-ietf-httpbis-p5-range-15" anchor="changes.since.15">
1761<t>
1762  Closed issues:
1763  <list style="symbols">
1764    <t>
1765      <eref target="http://trac.tools.ietf.org/wg/httpbis/trac/ticket/175"/>:
1766      "Security consideration: range flooding"
1767    </t>
1768  </list>
1769</t>
1770</section>
1771
1772<section title="Since draft-ietf-httpbis-p5-range-16" anchor="changes.since.16">
1773<t>
1774  Closed issues:
1775  <list style="symbols"> 
1776    <t>
1777      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/186"/>:
1778      "Document HTTP's error-handling philosophy"
1779    </t>
1780    <t>
1781      <eref target="http://trac.tools.ietf.org/wg/httpbis/trac/ticket/301"/>:
1782      "Content-Range on responses other than 206"
1783    </t>
1784    <t>
1785      <eref target="http://trac.tools.ietf.org/wg/httpbis/trac/ticket/319"/>:
1786      "case sensitivity of ranges in p5"
1787    </t>
1788  </list>
1789</t>
1790</section>
1791
1792</section>
1793
1794</back>
1795</rfc>
Note: See TracBrowser for help on using the repository browser.