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

Last change on this file since 1355 was 1355, checked in by ylafon@…, 12 years ago

Added security consideration on range flooding (See #175)

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