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

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

editorial fixes (#553)

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