source: draft-ietf-httpbis/20/draft-ietf-httpbis-p5-range-20.xml

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

Remove mentions of "seven" parts.

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