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

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

augment security considerations with pointers to current research (see #549)

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