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

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

simplify ABNF

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