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

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

Consistency in registration descriptions, also add required fields for status code registrations (related to #464).

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