Changeset 2135


Ignore:
Timestamp:
Jan 19, 2013, 5:58:48 PM (7 years ago)
Author:
fielding@…
Message:

Cleanup on aisle p5. Addresses #405

Don't refer to Range Units as Range Specifiers;
move requirements on unknown ranges to the header field definitions.
Disentangle the Content-Range ABNF so that it correctly distinguishes between
the three different forms in use and does not allow them to be mixed.
Use the new ABNF alternatives to simplify the prose.

Location:
draft-ietf-httpbis/latest
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • draft-ietf-httpbis/latest/httpbis.abnf

    r2083 r2135  
    1818Content-Length = 1*DIGIT
    1919Content-Location = absolute-URI / partial-URI
    20 Content-Range = byte-content-range-spec / other-content-range-spec
     20Content-Range = byte-content-range / other-content-range
    2121Content-Type = media-type
    2222Date = HTTP-date
     
    7373authority = <authority, defined in [RFC3986], Section 3.2>
    7474authority-form = authority
    75 byte-content-range-spec = bytes-unit SP byte-range-resp-spec "/" ( instance-length / "*" )
    76 byte-range-resp-spec = ( first-byte-pos "-" last-byte-pos ) / "*"
     75byte-content-range = bytes-unit SP ( byte-range-resp "/" unsatisfied-range )
     76byte-range = first-byte-pos "-" last-byte-pos
     77byte-range-resp = byte-range "/" ( complete-length / "*" )
    7778byte-range-set = *( "," OWS ) ( byte-range-spec / suffix-byte-range-spec ) *( OWS "," [ OWS ( byte-range-spec / suffix-byte-range-spec ) ] )
    7879byte-range-spec = first-byte-pos "-" [ last-byte-pos ]
     
    9192codings = content-coding / "identity" / "*"
    9293comment = "(" *( ctext / quoted-cpair / comment ) ")"
     94complete-length = 1*DIGIT
    9395connection-option = token
    9496content-coding = token
     
    135137http-URI = "http://" authority path-abempty [ "?" query ]
    136138https-URI = "https://" authority path-abempty [ "?" query ]
    137 instance-length = 1*DIGIT
    138139language-range = <language-range, defined in [RFC4647], Section 2.1>
    139140language-tag = <Language-Tag, defined in [RFC5646], Section 2.1>
     
    164165opaque-tag = DQUOTE *etagc DQUOTE
    165166origin-form = path-absolute [ "?" query ]
    166 other-content-range-spec = other-range-unit SP other-range-resp-spec
    167 other-range-resp-spec = *CHAR
     167other-content-range = other-range-unit SP other-range-resp
     168other-range-resp = *CHAR
    168169other-range-set = 1*CHAR
    169170other-range-unit = token
     
    221222transfer-parameter = attribute BWS "=" BWS value
    222223type = token
     224unsatisfied-range = "*/" complete-length
    223225uri-host = <host, defined in [RFC3986], Section 3.2.2>
    224226value = word
  • draft-ietf-httpbis/latest/p5-range.html

    r2134 r2135  
    577577         </li>
    578578         <li><a href="#rfc.section.2">2.</a>&nbsp;&nbsp;&nbsp;<a href="#range.units">Range Units</a><ul>
    579                <li><a href="#rfc.section.2.1">2.1</a>&nbsp;&nbsp;&nbsp;<a href="#range.specifier.registry">Range Specifier Registry</a></li>
     579               <li><a href="#rfc.section.2.1">2.1</a>&nbsp;&nbsp;&nbsp;<a href="#range.unit.registry">Range Unit Registry</a></li>
    580580            </ul>
    581581         </li>
     
    655655      </p>
    656656      <h1 id="rfc.section.2"><a href="#rfc.section.2">2.</a>&nbsp;<a id="range.units" href="#range.units">Range Units</a></h1>
    657       <p id="rfc.section.2.p.1">HTTP/1.1 allows a client to request that only part (a range) of the representation be included within the response. HTTP/1.1
    658          uses range units in the <a href="#range.retrieval.requests" class="smpl">Range</a> (<a href="#header.range" id="rfc.xref.header.range.1" title="Range">Section&nbsp;5.4</a>) and <a href="#header.content-range" class="smpl">Content-Range</a> (<a href="#header.content-range" id="rfc.xref.header.content-range.1" title="Content-Range">Section&nbsp;5.2</a>) header fields. A representation can be broken down into subranges according to various structural units.
     657      <p id="rfc.section.2.p.1">A representation can be partitioned into subranges according to various structural units, depending on the structure inherent
     658         in the representation's media type. Such a <dfn>range unit</dfn> can be used in the <a href="#range.retrieval.requests" class="smpl">Range</a> (<a href="#header.range" id="rfc.xref.header.range.1" title="Range">Section&nbsp;5.4</a>) and <a href="#header.content-range" class="smpl">Content-Range</a> (<a href="#header.content-range" id="rfc.xref.header.content-range.1" title="Content-Range">Section&nbsp;5.2</a>) header fields to delineate the parts of a representation that are either requested or transferred, respectively.
    659659      </p>
    660660      <div id="rfc.figure.u.1"></div><pre class="inline"><span id="rfc.iref.g.1"></span><span id="rfc.iref.g.2"></span><span id="rfc.iref.g.3"></span>  <a href="#range.units" class="smpl">range-unit</a>       = <a href="#range.units" class="smpl">bytes-unit</a> / <a href="#range.units" class="smpl">other-range-unit</a>
    661661  <a href="#range.units" class="smpl">bytes-unit</a>       = "bytes"
    662662  <a href="#range.units" class="smpl">other-range-unit</a> = <a href="#imported.abnf" class="smpl">token</a>
    663 </pre><p id="rfc.section.2.p.3">HTTP/1.1 has been designed to allow implementations of applications that do not depend on knowledge of ranges. The only range
    664          unit defined by HTTP/1.1 is "bytes". Additional specifiers can be defined as described in <a href="#range.specifier.registry" title="Range Specifier Registry">Section&nbsp;2.1</a>.
    665       </p>
    666       <p id="rfc.section.2.p.4">If a range unit is not understood in a request, a server <em class="bcp14">MUST</em> ignore the whole <a href="#range.retrieval.requests" class="smpl">Range</a> header field (<a href="#header.range" id="rfc.xref.header.range.2" title="Range">Section&nbsp;5.4</a>). If a range unit is not understood in a response, an intermediary <em class="bcp14">SHOULD</em> pass the response to the client; a client <em class="bcp14">MUST</em> fail.
    667       </p>
    668       <h2 id="rfc.section.2.1"><a href="#rfc.section.2.1">2.1</a>&nbsp;<a id="range.specifier.registry" href="#range.specifier.registry">Range Specifier Registry</a></h2>
    669       <p id="rfc.section.2.1.p.1">The HTTP Range Specifier Registry defines the name space for the range specifier names.</p>
     663</pre><p id="rfc.section.2.p.3">The only range unit defined by HTTP/1.1 is "bytes" (<a href="#byte.ranges" title="Byte Ranges">Section&nbsp;5.4.1</a>). Additional units can be defined as described in <a href="#range.unit.registry" title="Range Unit Registry">Section&nbsp;2.1</a>.
     664      </p>
     665      <h2 id="rfc.section.2.1"><a href="#rfc.section.2.1">2.1</a>&nbsp;<a id="range.unit.registry" href="#range.unit.registry">Range Unit Registry</a></h2>
     666      <p id="rfc.section.2.1.p.1">The HTTP Range Unit Registry defines the name space for the range unit names and refers to their corresponding specifications.</p>
    670667      <p id="rfc.section.2.1.p.2">Registrations <em class="bcp14">MUST</em> include the following fields:
    671668      </p>
     
    682679      <div id="rfc.iref.3"></div>
    683680      <h2 id="rfc.section.3.1"><a href="#rfc.section.3.1">3.1</a>&nbsp;<a id="status.206" href="#status.206">206 Partial Content</a></h2>
    684       <p id="rfc.section.3.1.p.1">The <dfn>206 (Partial Content)</dfn> status code indicates that the server has fulfilled the partial GET request for the resource. The request <em class="bcp14">MUST</em> have included a <a href="#range.retrieval.requests" class="smpl">Range</a> header field (<a href="#header.range" id="rfc.xref.header.range.3" title="Range">Section&nbsp;5.4</a>) indicating the desired range, and <em class="bcp14">MAY</em> have included an <a href="#header.if-range" class="smpl">If-Range</a> header field (<a href="#header.if-range" id="rfc.xref.header.if-range.1" title="If-Range">Section&nbsp;5.3</a>) to make the request conditional.
     681      <p id="rfc.section.3.1.p.1">The <dfn>206 (Partial Content)</dfn> status code indicates that the server has fulfilled the partial GET request for the resource. The request <em class="bcp14">MUST</em> have included a <a href="#range.retrieval.requests" class="smpl">Range</a> header field (<a href="#header.range" id="rfc.xref.header.range.2" title="Range">Section&nbsp;5.4</a>) indicating the desired range, and <em class="bcp14">MAY</em> have included an <a href="#header.if-range" class="smpl">If-Range</a> header field (<a href="#header.if-range" id="rfc.xref.header.if-range.1" title="If-Range">Section&nbsp;5.3</a>) to make the request conditional.
    685682      </p>
    686683      <p id="rfc.section.3.1.p.2">When a 206 response is generated, the sender <em class="bcp14">MUST</em> generate the following header fields:
     
    699696      <div id="rfc.iref.3"></div>
    700697      <h2 id="rfc.section.3.2"><a href="#rfc.section.3.2">3.2</a>&nbsp;<a id="status.416" href="#status.416">416 Range Not Satisfiable</a></h2>
    701       <p id="rfc.section.3.2.p.1">The <dfn>416 (Range Not Satisfiable)</dfn> status code indicates that none of the ranges-specifier values in the request's <a href="#range.retrieval.requests" class="smpl">Range</a> header field (<a href="#header.range" id="rfc.xref.header.range.4" title="Range">Section&nbsp;5.4</a>) overlap the current extent of the selected resource and the request did not include an <a href="#header.if-range" class="smpl">If-Range</a> header field (<a href="#header.if-range" id="rfc.xref.header.if-range.2" title="If-Range">Section&nbsp;5.3</a>). (For byte-ranges, this means that the first-byte-pos of all of the byte-range-spec values were greater than the current
     698      <p id="rfc.section.3.2.p.1">The <dfn>416 (Range Not Satisfiable)</dfn> status code indicates that none of the ranges-specifier values in the request's <a href="#range.retrieval.requests" class="smpl">Range</a> header field (<a href="#header.range" id="rfc.xref.header.range.3" title="Range">Section&nbsp;5.4</a>) overlap the current extent of the selected resource and the request did not include an <a href="#header.if-range" class="smpl">If-Range</a> header field (<a href="#header.if-range" id="rfc.xref.header.if-range.2" title="If-Range">Section&nbsp;5.3</a>). (For byte-ranges, this means that the first-byte-pos of all of the byte-range-spec values were greater than the current
    702699         length of the selected representation.)
    703700      </p>
     
    776773         body is intended to be applied.
    777774      </p>
    778       <p id="rfc.section.5.2.p.2">Range units are defined in <a href="#range.units" title="Range Units">Section&nbsp;2</a>.
    779       </p>
    780       <div id="rfc.figure.u.7"></div><pre class="inline"><span id="rfc.iref.g.6"></span><span id="rfc.iref.g.7"></span><span id="rfc.iref.g.8"></span><span id="rfc.iref.g.9"></span>  <a href="#header.content-range" class="smpl">Content-Range</a>           = <a href="#header.content-range" class="smpl">byte-content-range-spec</a>
    781                           / <a href="#header.content-range" class="smpl">other-content-range-spec</a>
     775      <div id="rfc.figure.u.7"></div><pre class="inline"><span id="rfc.iref.g.6"></span><span id="rfc.iref.g.7"></span><span id="rfc.iref.g.8"></span><span id="rfc.iref.g.9"></span><span id="rfc.iref.g.10"></span><span id="rfc.iref.g.11"></span><span id="rfc.iref.g.12"></span><span id="rfc.iref.g.13"></span>  <a href="#header.content-range" class="smpl">Content-Range</a>       = <a href="#header.content-range" class="smpl">byte-content-range</a>
     776                      / <a href="#header.content-range" class="smpl">other-content-range</a>
    782777                         
    783   <a href="#header.content-range" class="smpl">byte-content-range-spec</a> = <a href="#range.units" class="smpl">bytes-unit</a> <a href="#imported.abnf" class="smpl">SP</a>
    784                             <a href="#header.content-range" class="smpl">byte-range-resp-spec</a> "/"
    785                             ( <a href="#header.content-range" class="smpl">instance-length</a> / "*" )
     778  <a href="#header.content-range" class="smpl">byte-content-range</a>  = <a href="#range.units" class="smpl">bytes-unit</a> <a href="#imported.abnf" class="smpl">SP</a>
     779                        ( <a href="#header.content-range" class="smpl">byte-range-resp</a> "/" <a href="#header.content-range" class="smpl">unsatisfied-range</a> )
     780
     781  <a href="#header.content-range" class="smpl">byte-range-resp</a>     = <a href="#header.content-range" class="smpl">byte-range</a> "/" ( <a href="#header.content-range" class="smpl">complete-length</a> / "*" )
     782  <a href="#header.content-range" class="smpl">byte-range</a>          = <a href="#rule.ranges-specifier" class="smpl">first-byte-pos</a> "-" <a href="#rule.ranges-specifier" class="smpl">last-byte-pos</a>
     783  <a href="#header.content-range" class="smpl">unsatisfied-range</a>   = "*/" <a href="#header.content-range" class="smpl">complete-length</a>
     784                         
     785  <a href="#header.content-range" class="smpl">complete-length</a>     = 1*<a href="#imported.abnf" class="smpl">DIGIT</a>
    786786 
    787   <a href="#header.content-range" class="smpl">byte-range-resp-spec</a>    = (<a href="#rule.ranges-specifier" class="smpl">first-byte-pos</a> "-" <a href="#rule.ranges-specifier" class="smpl">last-byte-pos</a>)
    788                           / "*"
    789                          
    790   <a href="#header.content-range" class="smpl">instance-length</a>         = 1*<a href="#imported.abnf" class="smpl">DIGIT</a>
    791  
    792   <a href="#header.content-range" class="smpl">other-content-range-spec</a> = <a href="#range.units" class="smpl">other-range-unit</a> <a href="#imported.abnf" class="smpl">SP</a>
    793                              <a href="#header.content-range" class="smpl">other-range-resp-spec</a>
    794   <a href="#header.content-range" class="smpl">other-range-resp-spec</a>    = *<a href="#imported.abnf" class="smpl">CHAR</a>
    795 </pre><p id="rfc.section.5.2.p.4">The header field <em class="bcp14">SHOULD</em> indicate the total length of the full representation, unless this length is unknown or difficult to determine. The asterisk
    796          "*" character means that the instance-length is unknown at the time when the response was generated.
    797       </p>
    798       <p id="rfc.section.5.2.p.5">Unlike byte-ranges-specifier values (see <a href="#byte.ranges" title="Byte Ranges">Section&nbsp;5.4.1</a>), a byte-range-resp-spec <em class="bcp14">MUST</em> only specify one range, and <em class="bcp14">MUST</em> contain absolute byte positions for both the first and last byte of the range.
    799       </p>
    800       <p id="rfc.section.5.2.p.6">A byte-content-range-spec with a byte-range-resp-spec whose last-byte-pos value is less than its first-byte-pos value, or
    801          whose instance-length value is less than or equal to its last-byte-pos value, is invalid. The recipient of an invalid byte-content-range-spec <em class="bcp14">MUST</em> ignore it and any content transferred along with it.
    802       </p>
    803       <p id="rfc.section.5.2.p.7">In the case of a byte range request: a server sending a response with status code <a href="#status.416" class="smpl">416 (Range Not Satisfiable)</a>  <em class="bcp14">SHOULD</em> send a Content-Range field with a byte-range-resp-spec of "*". The instance-length specifies the current length of the selected
    804          resource. A server <em class="bcp14">MUST NOT</em> generate a a Content-Range field with a byte-range-resp-spec of "*" in a <a href="#status.206" class="smpl">206 (Partial Content)</a> response.
    805       </p>
    806       <p id="rfc.section.5.2.p.8">The "Content-Range" header field has no meaning for status codes that do not explicitly describe its semantic. Currently,
    807          only status codes <a href="#status.206" class="smpl">206 (Partial Content)</a> and <a href="#status.416" class="smpl">416 (Range Not Satisfiable)</a> describe the meaning of this header field.
    808       </p>
    809       <p id="rfc.section.5.2.p.9">Examples of byte-content-range-spec values, assuming that the representation contains a total of 1234 bytes: </p>
     787  <a href="#header.content-range" class="smpl">other-content-range</a> = <a href="#range.units" class="smpl">other-range-unit</a> <a href="#imported.abnf" class="smpl">SP</a> <a href="#header.content-range" class="smpl">other-range-resp</a>
     788  <a href="#header.content-range" class="smpl">other-range-resp</a>    = *<a href="#imported.abnf" class="smpl">CHAR</a>
     789</pre><p id="rfc.section.5.2.p.3">Range units are defined in <a href="#range.units" title="Range Units">Section&nbsp;2</a>. A recipient of a <a href="#status.206" class="smpl">206 (Partial Content)</a> response containing a <a href="#header.content-range" class="smpl">Content-Range</a> header field with a <a href="#range.units" class="smpl">range unit</a> that the recipient does not understand <em class="bcp14">MUST NOT</em> attempt to recombine it with a stored representation. A proxy that receives such a message <em class="bcp14">SHOULD</em> forward it downstream.
     790      </p>
     791      <p id="rfc.section.5.2.p.4">For byte ranges, a sender <em class="bcp14">SHOULD</em> indicate the complete length of the representation from which the range has been extracted unless the complete length is unknown
     792         or difficult to determine. An asterisk character ("*") in place of the complete-length indicates that the representation length
     793         was unknown when the header field was generated.
     794      </p>
     795      <p id="rfc.section.5.2.p.5">A Content-Range field value with a <a href="#header.content-range" class="smpl">byte-range-resp</a> that has a <a href="#rule.ranges-specifier" class="smpl">last-byte-pos</a> value less than its <a href="#rule.ranges-specifier" class="smpl">first-byte-pos</a> value, or a <a href="#header.content-range" class="smpl">complete-length</a> value less than or equal to its <a href="#rule.ranges-specifier" class="smpl">last-byte-pos</a> value, is invalid. The recipient of an invalid <a href="#header.content-range" class="smpl">Content-Range</a>  <em class="bcp14">MUST NOT</em> attempt to recombine the received content with a stored representation.
     796      </p>
     797      <p id="rfc.section.5.2.p.6">A server generating a <a href="#status.206" class="smpl">206 (Partial Content)</a> response to a byte range request <em class="bcp14">MUST</em> send, in each body-part of a multipart response or in the header block of a single part response, a Content-Range header field
     798         containing a <a href="#header.content-range" class="smpl">byte-range-resp</a> value that reflects the corresponding range being sent. The following example would apply when the complete length of the
     799         selected representation is known by the sender to be 1234 bytes:
     800      </p>
     801      <div id="rfc.figure.u.8"></div><pre class="text">  Content-Range: bytes 42-1233/1234
     802</pre><p id="rfc.section.5.2.p.8">or this second example would apply when the complete length is unknown:</p>
     803      <div id="rfc.figure.u.9"></div><pre class="text">  Content-Range: bytes 42-1233/*
     804</pre><p id="rfc.section.5.2.p.10">A server generating a <a href="#status.416" class="smpl">416 (Range Not Satisfiable)</a> response to a byte range request <em class="bcp14">SHOULD</em> send a Content-Range header field with an <a href="#header.content-range" class="smpl">unsatisfied-range</a> value, as in the following example:
     805      </p>
     806      <div id="rfc.figure.u.10"></div><pre class="text">  Content-Range: bytes */1234
     807</pre><p id="rfc.section.5.2.p.12">The complete-length in a 416 response indicates the current length of the selected representation, which will be known by
     808         the server generating the response because that is how it determined the range to be unsatisfiable.
     809      </p>
     810      <p id="rfc.section.5.2.p.13">The "Content-Range" header field has no meaning for status codes that do not explicitly describe its semantic. For this specification,
     811         only the <a href="#status.206" class="smpl">206 (Partial Content)</a> and <a href="#status.416" class="smpl">416 (Range Not Satisfiable)</a> status codes describe a meaning for Content-Range.
     812      </p>
     813      <p id="rfc.section.5.2.p.14">More examples of Content-Range values, assuming that the representation contains a total of 1234 bytes: </p>
    810814      <ul>
    811815         <li>The first 500 bytes:
    812             <div id="rfc.figure.u.8"></div><pre class="text"> bytes 0-499/1234
     816            <div id="rfc.figure.u.11"></div><pre class="text">  Content-Range: bytes 0-499/1234
    813817</pre> </li>
    814818         <li>The second 500 bytes:
    815             <div id="rfc.figure.u.9"></div><pre class="text"> bytes 500-999/1234
     819            <div id="rfc.figure.u.12"></div><pre class="text">  Content-Range: bytes 500-999/1234
    816820</pre> </li>
    817821         <li>All except for the first 500 bytes:
    818             <div id="rfc.figure.u.10"></div><pre class="text"> bytes 500-1233/1234
     822            <div id="rfc.figure.u.13"></div><pre class="text">  Content-Range: bytes 500-1233/1234
    819823</pre> </li>
    820824         <li>The last 500 bytes:
    821             <div id="rfc.figure.u.11"></div><pre class="text"> bytes 734-1233/1234
     825            <div id="rfc.figure.u.14"></div><pre class="text">  Content-Range: bytes 734-1233/1234
    822826</pre> </li>
    823827      </ul>
     
    831835         is unchanged, send me the part(s) that I am requesting in Range; otherwise, send me the entire representation.
    832836      </p>
    833       <div id="rfc.figure.u.12"></div><pre class="inline"><span id="rfc.iref.g.10"></span>  <a href="#header.if-range" class="smpl">If-Range</a> = <a href="#imported.abnf" class="smpl">entity-tag</a> / <a href="#imported.abnf" class="smpl">HTTP-date</a>
     837      <div id="rfc.figure.u.15"></div><pre class="inline"><span id="rfc.iref.g.14"></span>  <a href="#header.if-range" class="smpl">If-Range</a> = <a href="#imported.abnf" class="smpl">entity-tag</a> / <a href="#imported.abnf" class="smpl">HTTP-date</a>
    834838</pre><p id="rfc.section.5.3.p.4">Clients <em class="bcp14">MUST NOT</em> use an entity-tag marked as weak in an If-Range field value and <em class="bcp14">MUST NOT</em> use a <a href="p4-conditional.html#header.last-modified" class="smpl">Last-Modified</a> date in an If-Range field value unless it has no entity-tag for the representation and the Last-Modified date it does have
    835839         for the representation is strong in the sense defined by <a href="p4-conditional.html#lastmod.comparison" title="Comparison">Section 2.2.2</a> of <a href="#Part4" id="rfc.xref.Part4.3"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[Part4]</cite></a>.
     
    856860         </p>
    857861      </div>
    858       <div id="rfc.figure.u.13"></div><pre class="inline"><span id="rfc.iref.g.11"></span><span id="rfc.iref.g.12"></span><span id="rfc.iref.g.13"></span><span id="rfc.iref.g.14"></span><span id="rfc.iref.g.15"></span><span id="rfc.iref.g.16"></span>  <a href="#rule.ranges-specifier" class="smpl">byte-ranges-specifier</a> = <a href="#range.units" class="smpl">bytes-unit</a> "=" <a href="#rule.ranges-specifier" class="smpl">byte-range-set</a>
     862      <div id="rfc.figure.u.16"></div><pre class="inline"><span id="rfc.iref.g.15"></span><span id="rfc.iref.g.16"></span><span id="rfc.iref.g.17"></span><span id="rfc.iref.g.18"></span><span id="rfc.iref.g.19"></span><span id="rfc.iref.g.20"></span>  <a href="#rule.ranges-specifier" class="smpl">byte-ranges-specifier</a> = <a href="#range.units" class="smpl">bytes-unit</a> "=" <a href="#rule.ranges-specifier" class="smpl">byte-range-set</a>
    859863  <a href="#rule.ranges-specifier" class="smpl">byte-range-set</a>  = 1#( <a href="#rule.ranges-specifier" class="smpl">byte-range-spec</a> / <a href="#rule.ranges-specifier" class="smpl">suffix-byte-range-spec</a> )
    860864  <a href="#rule.ranges-specifier" class="smpl">byte-range-spec</a> = <a href="#rule.ranges-specifier" class="smpl">first-byte-pos</a> "-" [ <a href="#rule.ranges-specifier" class="smpl">last-byte-pos</a> ]
     
    872876      </p>
    873877      <p id="rfc.section.5.4.1.p.8">By its choice of last-byte-pos, a client can limit the number of bytes retrieved without knowing the size of the representation.</p>
    874       <div id="rfc.figure.u.14"></div><pre class="inline"><span id="rfc.iref.g.17"></span><span id="rfc.iref.g.18"></span>  <a href="#rule.ranges-specifier" class="smpl">suffix-byte-range-spec</a> = "-" <a href="#rule.ranges-specifier" class="smpl">suffix-length</a>
     878      <div id="rfc.figure.u.17"></div><pre class="inline"><span id="rfc.iref.g.21"></span><span id="rfc.iref.g.22"></span>  <a href="#rule.ranges-specifier" class="smpl">suffix-byte-range-spec</a> = "-" <a href="#rule.ranges-specifier" class="smpl">suffix-length</a>
    875879  <a href="#rule.ranges-specifier" class="smpl">suffix-length</a> = 1*<a href="#imported.abnf" class="smpl">DIGIT</a>
    876880</pre><p id="rfc.section.5.4.1.p.10">A suffix-byte-range-spec is used to specify the suffix of the representation data, of a length given by the suffix-length
     
    887891      <ul>
    888892         <li>The first 500 bytes (byte offsets 0-499, inclusive):
    889             <div id="rfc.figure.u.15"></div><pre class="text">  bytes=0-499
     893            <div id="rfc.figure.u.18"></div><pre class="text">  bytes=0-499
    890894</pre> </li>
    891895         <li>The second 500 bytes (byte offsets 500-999, inclusive):
    892             <div id="rfc.figure.u.16"></div><pre class="text">  bytes=500-999
     896            <div id="rfc.figure.u.19"></div><pre class="text">  bytes=500-999
    893897</pre> </li>
    894898         <li>The final 500 bytes (byte offsets 9500-9999, inclusive):
    895             <div id="rfc.figure.u.17"></div><pre class="text">  bytes=-500
    896 </pre> Or: <div id="rfc.figure.u.18"></div><pre class="text">  bytes=9500-
     899            <div id="rfc.figure.u.20"></div><pre class="text">  bytes=-500
     900</pre> Or: <div id="rfc.figure.u.21"></div><pre class="text">  bytes=9500-
    897901</pre> </li>
    898902         <li>The first and last bytes only (bytes 0 and 9999):
    899             <div id="rfc.figure.u.19"></div><pre class="text">  bytes=0-0,-1
     903            <div id="rfc.figure.u.22"></div><pre class="text">  bytes=0-0,-1
    900904</pre> </li>
    901905         <li>Several legal but not canonical specifications of the second 500 bytes (byte offsets 500-999, inclusive):
    902             <div id="rfc.figure.u.20"></div><pre class="text">  bytes=500-600,601-999
     906            <div id="rfc.figure.u.23"></div><pre class="text">  bytes=500-600,601-999
    903907  bytes=500-700,601-999
    904908</pre> </li>
     
    908912         of the selected representation data in a successful response, rather than the entire representation data.
    909913      </p>
    910       <div id="rfc.figure.u.21"></div><pre class="inline"><span id="rfc.iref.g.19"></span>  <a href="#range.retrieval.requests" class="smpl">Range</a> = <a href="#rule.ranges-specifier" class="smpl">byte-ranges-specifier</a> / <a href="#range.retrieval.requests" class="smpl">other-ranges-specifier</a>
     914      <div id="rfc.figure.u.24"></div><pre class="inline"><span id="rfc.iref.g.23"></span>  <a href="#range.retrieval.requests" class="smpl">Range</a> = <a href="#rule.ranges-specifier" class="smpl">byte-ranges-specifier</a> / <a href="#range.retrieval.requests" class="smpl">other-ranges-specifier</a>
    911915  <a href="#range.retrieval.requests" class="smpl">other-ranges-specifier</a> = <a href="#range.units" class="smpl">other-range-unit</a> "=" <a href="#range.retrieval.requests" class="smpl">other-range-set</a>
    912916  <a href="#range.retrieval.requests" class="smpl">other-range-set</a> = 1*<a href="#imported.abnf" class="smpl">CHAR</a>
     
    915919         server <em class="bcp14">MUST</em> ignore a Range header field received with a request method other than GET.
    916920      </p>
    917       <p id="rfc.section.5.4.2.p.4">The Range header field is evaluated after evaluating the preconditions of <a href="#Part4" id="rfc.xref.Part4.5"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[Part4]</cite></a> and only if the result of their evaluation is leading toward a <a href="p2-semantics.html#status.200" class="smpl">200 (OK)</a> response. In other words, Range is ignored when a conditional GET would result in a <a href="p4-conditional.html#status.304" class="smpl">304 (Not Modified)</a> response.
    918       </p>
    919       <p id="rfc.section.5.4.2.p.5">The If-Range header field (<a href="#header.if-range" id="rfc.xref.header.if-range.3" title="If-Range">Section&nbsp;5.3</a>) can be used as a precondition to applying the Range header field.
    920       </p>
    921       <p id="rfc.section.5.4.2.p.6">If all of the preconditions are true, the server supports the Range header field for the target resource, the specified range(s)
     921      <p id="rfc.section.5.4.2.p.4">An origin server <em class="bcp14">MUST</em> ignore a <a href="#range.retrieval.requests" class="smpl">Range</a> header field that contains a range unit it does not understand. A proxy <em class="bcp14">MAY</em> either discard a <a href="#range.retrieval.requests" class="smpl">Range</a> header field that contains a range unit it does not understand or pass it to the next inbound server when forwarding the request.
     922      </p>
     923      <p id="rfc.section.5.4.2.p.5">The Range header field is evaluated after evaluating the preconditions of <a href="#Part4" id="rfc.xref.Part4.5"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[Part4]</cite></a> and only if the result of their evaluation is leading toward a <a href="p2-semantics.html#status.200" class="smpl">200 (OK)</a> response. In other words, Range is ignored when a conditional GET would result in a <a href="p4-conditional.html#status.304" class="smpl">304 (Not Modified)</a> response.
     924      </p>
     925      <p id="rfc.section.5.4.2.p.6">The If-Range header field (<a href="#header.if-range" id="rfc.xref.header.if-range.3" title="If-Range">Section&nbsp;5.3</a>) can be used as a precondition to applying the Range header field.
     926      </p>
     927      <p id="rfc.section.5.4.2.p.7">If all of the preconditions are true, the server supports the Range header field for the target resource, the specified range(s)
    922928         are syntactically correct (as defined in <a href="#byte.ranges" title="Byte Ranges">Section&nbsp;5.4.1</a>), and at least one of the ranges has a non-empty intersection with the current selected representation extent, then the server <em class="bcp14">MAY</em> respond with a status code of <a href="#status.206" class="smpl">206 (Partial Content)</a> and a payload containing one or more partial representations that correspond to those requested, as defined in <a href="#range.response" title="Responses to a Range Request">Section&nbsp;4</a>.
    923929      </p>
     
    992998                  <td class="left">http</td>
    993999                  <td class="left">standard</td>
    994                   <td class="left"> <a href="#header.range" id="rfc.xref.header.range.5" title="Range">Section&nbsp;5.4</a>
     1000                  <td class="left"> <a href="#header.range" id="rfc.xref.header.range.4" title="Range">Section&nbsp;5.4</a>
    9951001                  </td>
    9961002               </tr>
     
    10001006      <p id="rfc.section.6.2.p.2">The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".</p>
    10011007      <h2 id="rfc.section.6.3"><a href="#rfc.section.6.3">6.3</a>&nbsp;<a id="range.specifier.registration" href="#range.specifier.registration">Range Specifier Registration</a></h2>
    1002       <p id="rfc.section.6.3.p.1">The registration procedure for HTTP Range Specifiers is defined by <a href="#range.specifier.registry" title="Range Specifier Registry">Section&nbsp;2.1</a> of this document.
     1008      <p id="rfc.section.6.3.p.1">The registration procedure for HTTP Range Specifiers is defined by <a href="#range.unit.registry" title="Range Unit Registry">Section&nbsp;2.1</a> of this document.
    10031009      </p>
    10041010      <p id="rfc.section.6.3.p.2">The HTTP Range Specifier Registry shall be created at &lt;<a href="http://www.iana.org/assignments/http-range-specifiers">http://www.iana.org/assignments/http-range-specifiers</a>&gt; and be populated with the registrations below:
     
    11701176         </p>
    11711177      </div>
    1172       <div id="rfc.figure.u.22"></div>
     1178      <div id="rfc.figure.u.25"></div>
    11731179      <p>For example:</p><pre class="text">  HTTP/1.1 206 Partial Content
    11741180  Date: Wed, 15 Nov 1995 06:25:24 GMT
     
    11881194  ...the second range
    11891195  --THIS_STRING_SEPARATES--
    1190 </pre><div id="rfc.figure.u.23"></div>
     1196</pre><div id="rfc.figure.u.26"></div>
    11911197      <p>Another example, using the "exampleunit" range unit:</p>  <pre class="text">  HTTP/1.1 206 Partial Content
    11921198  Date: Tue, 14 Nov 1995 06:25:24 GMT
     
    12251231      <p id="rfc.section.B.p.4">multipart/byteranges can consist of a single part. (<a href="#internet.media.type.multipart.byteranges" title="Internet Media Type multipart/byteranges">Appendix&nbsp;A</a>)
    12261232      </p>
    1227       <p id="rfc.section.B.p.5">This specification introduces a Range Specifier Registry. (<a href="#range.specifier.registry" title="Range Specifier Registry">Section&nbsp;2.1</a>)
     1233      <p id="rfc.section.B.p.5">This specification introduces a Range Specifier Registry. (<a href="#range.unit.registry" title="Range Unit Registry">Section&nbsp;2.1</a>)
    12281234      </p>
    12291235      <h1 id="rfc.section.C"><a href="#rfc.section.C">C.</a>&nbsp;<a id="imported.abnf" href="#imported.abnf">Imported ABNF</a></h1>
     
    12361242      <p id="rfc.section.C.p.3">The rules below are defined in <a href="#Part1" id="rfc.xref.Part1.5"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[Part1]</cite></a>:
    12371243      </p>
    1238       <div id="rfc.figure.u.24"></div><pre class="inline">  <a href="#imported.abnf" class="smpl">OWS</a>        = &lt;OWS, defined in <a href="#Part1" id="rfc.xref.Part1.6"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[Part1]</cite></a>, <a href="p1-messaging.html#whitespace" title="Whitespace">Section 3.2.3</a>&gt;
     1244      <div id="rfc.figure.u.27"></div><pre class="inline">  <a href="#imported.abnf" class="smpl">OWS</a>        = &lt;OWS, defined in <a href="#Part1" id="rfc.xref.Part1.6"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[Part1]</cite></a>, <a href="p1-messaging.html#whitespace" title="Whitespace">Section 3.2.3</a>&gt;
    12391245  <a href="#imported.abnf" class="smpl">token</a>      = &lt;token, defined in <a href="#Part1" id="rfc.xref.Part1.7"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[Part1]</cite></a>, <a href="p1-messaging.html#field.components" title="Field value components">Section 3.2.6</a>&gt;
    12401246</pre><p id="rfc.section.C.p.5">The rules below are defined in other parts:</p>
    1241       <div id="rfc.figure.u.25"></div><pre class="inline">  <a href="#imported.abnf" class="smpl">HTTP-date</a>  = &lt;HTTP-date, defined in <a href="#Part2" id="rfc.xref.Part2.2"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[Part2]</cite></a>, <a href="p2-semantics.html#http.date" title="Date/Time Formats">Section 7.1.1.1</a>&gt;
     1247      <div id="rfc.figure.u.28"></div><pre class="inline">  <a href="#imported.abnf" class="smpl">HTTP-date</a>  = &lt;HTTP-date, defined in <a href="#Part2" id="rfc.xref.Part2.2"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[Part2]</cite></a>, <a href="p2-semantics.html#http.date" title="Date/Time Formats">Section 7.1.1.1</a>&gt;
    12421248  <a href="#imported.abnf" class="smpl">entity-tag</a> = &lt;entity-tag, defined in <a href="#Part4" id="rfc.xref.Part4.6"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[Part4]</cite></a>, <a href="p4-conditional.html#header.etag" title="ETag">Section 2.3</a>&gt;
    12431249</pre><h1 id="rfc.section.D"><a href="#rfc.section.D">D.</a>&nbsp;<a id="collected.abnf" href="#collected.abnf">Collected ABNF</a></h1>
    1244       <div id="rfc.figure.u.26"></div> <pre class="inline"><a href="#header.accept-ranges" class="smpl">Accept-Ranges</a> = acceptable-ranges
    1245 
    1246 <a href="#header.content-range" class="smpl">Content-Range</a> = byte-content-range-spec / other-content-range-spec
     1250      <div id="rfc.figure.u.29"></div> <pre class="inline"><a href="#header.accept-ranges" class="smpl">Accept-Ranges</a> = acceptable-ranges
     1251
     1252<a href="#header.content-range" class="smpl">Content-Range</a> = byte-content-range / other-content-range
    12471253
    12481254<a href="#imported.abnf" class="smpl">HTTP-date</a> = &lt;HTTP-date, defined in [Part2], Section 7.1.1.1&gt;
     
    12571263 range-unit ] ) ) / "none"
    12581264
    1259 <a href="#header.content-range" class="smpl">byte-content-range-spec</a> = bytes-unit SP byte-range-resp-spec "/" (
    1260  instance-length / "*" )
    1261 <a href="#header.content-range" class="smpl">byte-range-resp-spec</a> = ( first-byte-pos "-" last-byte-pos ) / "*"
     1265<a href="#header.content-range" class="smpl">byte-content-range</a> = bytes-unit SP ( byte-range-resp "/"
     1266 unsatisfied-range )
     1267<a href="#header.content-range" class="smpl">byte-range</a> = first-byte-pos "-" last-byte-pos
     1268<a href="#header.content-range" class="smpl">byte-range-resp</a> = byte-range "/" ( complete-length / "*" )
    12621269<a href="#rule.ranges-specifier" class="smpl">byte-range-set</a> = *( "," OWS ) ( byte-range-spec /
    12631270 suffix-byte-range-spec ) *( OWS "," [ OWS ( byte-range-spec /
     
    12671274<a href="#range.units" class="smpl">bytes-unit</a> = "bytes"
    12681275
     1276<a href="#header.content-range" class="smpl">complete-length</a> = 1*DIGIT
     1277
    12691278<a href="#imported.abnf" class="smpl">entity-tag</a> = &lt;entity-tag, defined in [Part4], Section 2.3&gt;
    12701279
    12711280<a href="#rule.ranges-specifier" class="smpl">first-byte-pos</a> = 1*DIGIT
    12721281
    1273 <a href="#header.content-range" class="smpl">instance-length</a> = 1*DIGIT
    1274 
    12751282<a href="#rule.ranges-specifier" class="smpl">last-byte-pos</a> = 1*DIGIT
    12761283
    1277 <a href="#header.content-range" class="smpl">other-content-range-spec</a> = other-range-unit SP other-range-resp-spec
    1278 <a href="#header.content-range" class="smpl">other-range-resp-spec</a> = *CHAR
     1284<a href="#header.content-range" class="smpl">other-content-range</a> = other-range-unit SP other-range-resp
     1285<a href="#header.content-range" class="smpl">other-range-resp</a> = *CHAR
    12791286<a href="#range.retrieval.requests" class="smpl">other-range-set</a> = 1*CHAR
    12801287<a href="#range.units" class="smpl">other-range-unit</a> = token
     
    12871294
    12881295<a href="#imported.abnf" class="smpl">token</a> = &lt;token, defined in [Part1], Section 3.2.6&gt;
     1296
     1297<a href="#header.content-range" class="smpl">unsatisfied-range</a> = "*/" complete-length
    12891298</pre> <h1 id="rfc.section.E"><a href="#rfc.section.E">E.</a>&nbsp;<a id="change.log" href="#change.log">Change Log (to be removed by RFC Editor before publication)</a></h1>
    12901299      <p id="rfc.section.E.p.1">Changes up to the first Working Group Last Call draft are summarized in &lt;<a href="http://tools.ietf.org/html/draft-ietf-httpbis-p5-range-19#appendix-D">http://tools.ietf.org/html/draft-ietf-httpbis-p5-range-19#appendix-D</a>&gt;.
     
    13421351                        <li><tt>Accept-Ranges</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.4"><b>5.1</b></a></li>
    13431352                        <li><tt>acceptable-ranges</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.5"><b>5.1</b></a></li>
    1344                         <li><tt>byte-content-range-spec</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.7"><b>5.2</b></a></li>
    1345                         <li><tt>byte-range-resp-spec</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.8"><b>5.2</b></a></li>
    1346                         <li><tt>byte-range-set</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.13"><b>5.4.1</b></a></li>
    1347                         <li><tt>byte-range-spec</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.14"><b>5.4.1</b></a></li>
    1348                         <li><tt>byte-ranges-specifier</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.12"><b>5.4.1</b></a></li>
     1353                        <li><tt>byte-content-range</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.7"><b>5.2</b></a></li>
     1354                        <li><tt>byte-range</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.9"><b>5.2</b></a></li>
     1355                        <li><tt>byte-range-resp</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.8"><b>5.2</b></a></li>
     1356                        <li><tt>byte-range-set</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.17"><b>5.4.1</b></a></li>
     1357                        <li><tt>byte-range-spec</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.18"><b>5.4.1</b></a></li>
     1358                        <li><tt>byte-ranges-specifier</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.16"><b>5.4.1</b></a></li>
    13491359                        <li><tt>bytes-unit</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.2"><b>2</b></a></li>
     1360                        <li><tt>complete-length</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.13"><b>5.2</b></a></li>
    13501361                        <li><tt>Content-Range</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.6"><b>5.2</b></a></li>
    1351                         <li><tt>first-byte-pos</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.15"><b>5.4.1</b></a></li>
    1352                         <li><tt>If-Range</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.10"><b>5.3</b></a></li>
    1353                         <li><tt>instance-length</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.9"><b>5.2</b></a></li>
    1354                         <li><tt>last-byte-pos</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.16"><b>5.4.1</b></a></li>
     1362                        <li><tt>first-byte-pos</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.19"><b>5.4.1</b></a></li>
     1363                        <li><tt>If-Range</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.14"><b>5.3</b></a></li>
     1364                        <li><tt>last-byte-pos</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.20"><b>5.4.1</b></a></li>
     1365                        <li><tt>other-content-range</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.11"><b>5.2</b></a></li>
     1366                        <li><tt>other-range-resp</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.12"><b>5.2</b></a></li>
    13551367                        <li><tt>other-range-unit</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.3"><b>2</b></a></li>
    1356                         <li><tt>Range</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.19"><b>5.4.2</b></a></li>
     1368                        <li><tt>Range</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.23"><b>5.4.2</b></a></li>
    13571369                        <li><tt>range-unit</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.1"><b>2</b></a></li>
    1358                         <li><tt>ranges-specifier</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.11"><b>5.4.1</b></a></li>
    1359                         <li><tt>suffix-byte-range-spec</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.17"><b>5.4.1</b></a></li>
    1360                         <li><tt>suffix-length</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.18"><b>5.4.1</b></a></li>
     1370                        <li><tt>ranges-specifier</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.15"><b>5.4.1</b></a></li>
     1371                        <li><tt>suffix-byte-range-spec</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.21"><b>5.4.1</b></a></li>
     1372                        <li><tt>suffix-length</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.22"><b>5.4.1</b></a></li>
     1373                        <li><tt>unsatisfied-range</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.10"><b>5.2</b></a></li>
    13611374                     </ul>
    13621375                  </li>
     
    14031416            </li>
    14041417            <li><a id="rfc.index.R" href="#rfc.index.R"><b>R</b></a><ul>
    1405                   <li>Range header field&nbsp;&nbsp;<a href="#rfc.xref.header.range.1">2</a>, <a href="#rfc.xref.header.range.2">2</a>, <a href="#rfc.xref.header.range.3">3.1</a>, <a href="#rfc.xref.header.range.4">3.2</a>, <a href="#rfc.iref.r.1"><b>5.4</b></a>, <a href="#rfc.xref.header.range.5">6.2</a></li>
     1418                  <li>Range header field&nbsp;&nbsp;<a href="#rfc.xref.header.range.1">2</a>, <a href="#rfc.xref.header.range.2">3.1</a>, <a href="#rfc.xref.header.range.3">3.2</a>, <a href="#rfc.iref.r.1"><b>5.4</b></a>, <a href="#rfc.xref.header.range.4">6.2</a></li>
    14061419                  <li><em>RFC2046</em>&nbsp;&nbsp;<a href="#RFC2046"><b>9.1</b></a>, <a href="#rfc.xref.RFC2046.1">A</a>, <a href="#rfc.xref.RFC2046.2">A</a><ul>
    14071420                        <li><em>Section 5.1</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2046.1">A</a></li>
  • draft-ietf-httpbis/latest/p5-range.xml

    r2134 r2135  
    184184  <x:anchor-alias value="other-range-unit"/>
    185185  <x:anchor-alias value="range-unit"/>
    186 <t>
    187    HTTP/1.1 allows a client to request that only part (a range) of the
    188    representation be included within the response. HTTP/1.1 uses range
    189    units in the <x:ref>Range</x:ref> (<xref target="header.range"/>) and
     186  <x:anchor-alias value="range unit"/>
     187<t>
     188   A representation can be partitioned into subranges according to various
     189   structural units, depending on the structure inherent in the
     190   representation's media type. Such a <x:dfn>range unit</x:dfn> can be used
     191   in the <x:ref>Range</x:ref> (<xref target="header.range"/>) and
    190192   <x:ref>Content-Range</x:ref> (<xref target="header.content-range"/>)
    191    header fields. A representation can be broken down into subranges according
    192    to various structural units.
     193   header fields to delineate the parts of a representation that are
     194   either requested or transferred, respectively.
    193195</t>
    194196<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="range-unit"/><iref primary="true" item="Grammar" subitem="bytes-unit"/><iref primary="true" item="Grammar" subitem="other-range-unit"/>
     
    198200</artwork></figure>
    199201<t>
    200   HTTP/1.1 has been designed to allow implementations of applications
    201   that do not depend on knowledge of ranges. The only range unit defined
    202   by HTTP/1.1 is "bytes". Additional specifiers can be defined as described
    203   in <xref target="range.specifier.registry"/>.
    204 </t>
    205 <t>
    206   If a range unit is not understood in a request, a server &MUST; ignore
    207   the whole <x:ref>Range</x:ref> header field (<xref target="header.range"/>).
    208   If a range unit is not understood in a response, an intermediary
    209   &SHOULD; pass the response to the client; a client &MUST; fail.
    210 </t>
    211 
    212 <section title="Range Specifier Registry" anchor="range.specifier.registry">
    213 <t>
    214    The HTTP Range Specifier Registry defines the name space for the range
    215    specifier names.
     202  The only range unit defined by HTTP/1.1 is "bytes"
     203  (<xref target="byte.ranges"/>). Additional units can be defined as described
     204  in <xref target="range.unit.registry"/>.
     205</t>
     206
     207<section title="Range Unit Registry" anchor="range.unit.registry">
     208<t>
     209   The HTTP Range Unit Registry defines the name space for the range
     210   unit names and refers to their corresponding specifications.
    216211</t>
    217212<t>
     
    469464<section title="Content-Range" anchor="header.content-range">
    470465  <iref primary="true" item="Content-Range header field" x:for-anchor=""/>
    471   <x:anchor-alias value="byte-content-range-spec"/>
    472   <x:anchor-alias value="byte-range-resp-spec"/>
    473466  <x:anchor-alias value="Content-Range"/>
    474   <x:anchor-alias value="instance-length"/>
    475   <x:anchor-alias value="other-content-range-spec"/>
    476   <x:anchor-alias value="other-range-resp-spec"/>
     467  <x:anchor-alias value="byte-content-range"/>
     468  <x:anchor-alias value="byte-range-resp"/>
     469  <x:anchor-alias value="byte-range"/>
     470  <x:anchor-alias value="unsatisfied-range"/>
     471  <x:anchor-alias value="complete-length"/>
     472  <x:anchor-alias value="other-content-range"/>
     473  <x:anchor-alias value="other-range-resp"/>
    477474<t>
    478475   The "Content-Range" header field is sent with a partial representation to
     
    480477   applied.
    481478</t>
     479<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"/>
     480  <x:ref>Content-Range</x:ref>       = <x:ref>byte-content-range</x:ref>
     481                      / <x:ref>other-content-range</x:ref>
     482                         
     483  <x:ref>byte-content-range</x:ref>  = <x:ref>bytes-unit</x:ref> <x:ref>SP</x:ref>
     484                        ( <x:ref>byte-range-resp</x:ref> "/" <x:ref>unsatisfied-range</x:ref> )
     485
     486  <x:ref>byte-range-resp</x:ref>     = <x:ref>byte-range</x:ref> "/" ( <x:ref>complete-length</x:ref> / "*" )
     487  <x:ref>byte-range</x:ref>          = <x:ref>first-byte-pos</x:ref> "-" <x:ref>last-byte-pos</x:ref>
     488  <x:ref>unsatisfied-range</x:ref>   = "*/" <x:ref>complete-length</x:ref>
     489                         
     490  <x:ref>complete-length</x:ref>     = 1*<x:ref>DIGIT</x:ref>
     491 
     492  <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>
     493  <x:ref>other-range-resp</x:ref>    = *<x:ref>CHAR</x:ref>
     494</artwork></figure>
    482495<t>   
    483    Range units are defined in <xref target="range.units"/>.
    484 </t>
    485 <figure><artwork type="abnf2616"><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"/>
    486   <x:ref>Content-Range</x:ref>           = <x:ref>byte-content-range-spec</x:ref>
    487                           / <x:ref>other-content-range-spec</x:ref>
    488                          
    489   <x:ref>byte-content-range-spec</x:ref> = <x:ref>bytes-unit</x:ref> <x:ref>SP</x:ref>
    490                             <x:ref>byte-range-resp-spec</x:ref> "/"
    491                             ( <x:ref>instance-length</x:ref> / "*" )
    492  
    493   <x:ref>byte-range-resp-spec</x:ref>    = (<x:ref>first-byte-pos</x:ref> "-" <x:ref>last-byte-pos</x:ref>)
    494                           / "*"
    495                          
    496   <x:ref>instance-length</x:ref>         = 1*<x:ref>DIGIT</x:ref>
    497  
    498   <x:ref>other-content-range-spec</x:ref> = <x:ref>other-range-unit</x:ref> <x:ref>SP</x:ref>
    499                              <x:ref>other-range-resp-spec</x:ref>
    500   <x:ref>other-range-resp-spec</x:ref>    = *<x:ref>CHAR</x:ref>
    501 </artwork></figure>
    502 <t>
    503    The header field &SHOULD; indicate the total length of the full representation,
    504    unless this length is unknown or difficult to determine. The asterisk
    505    "*" character means that the instance-length is unknown at the time
    506    when the response was generated.
    507 </t>
    508 <t>
    509    Unlike byte-ranges-specifier values (see <xref target="byte.ranges"/>), a byte-range-resp-spec
    510    &MUST; only specify one range, and &MUST; contain
    511    absolute byte positions for both the first and last byte of the
    512    range.
    513 </t>
    514 <t>
    515    A byte-content-range-spec with a byte-range-resp-spec whose last-byte-pos
    516    value is less than its first-byte-pos value, or whose
    517    instance-length value is less than or equal to its last-byte-pos
    518    value, is invalid. The recipient of an invalid byte-content-range-spec
    519    &MUST; ignore it and any content transferred along with it.
    520 </t>
    521 <t>
    522    In the case of a byte range request: a server sending a response with
    523    status code <x:ref>416 (Range Not Satisfiable)</x:ref> &SHOULD; send a
    524    Content-Range field with a byte-range-resp-spec of "*".
    525    The instance-length specifies the current length of the selected resource.
    526    A server &MUST-NOT; generate a a Content-Range field with a
    527    byte-range-resp-spec of "*" in a <x:ref>206 (Partial Content)</x:ref>
    528    response.
    529 </t>
    530 <t>
    531   The "Content-Range" header field has no meaning for status codes that do not
    532   explicitly describe its semantic. Currently, only status codes
    533   <x:ref>206 (Partial Content)</x:ref> and <x:ref>416 (Range Not Satisfiable)</x:ref> describe
    534   the meaning of this header field.
    535 </t>
    536 <t>
    537    Examples of byte-content-range-spec values, assuming that the representation
     496   Range units are defined in <xref target="range.units"/>. A recipient of a
     497   <x:ref>206 (Partial Content)</x:ref> response containing a
     498   <x:ref>Content-Range</x:ref> header field with a <x:ref>range unit</x:ref>
     499   that the recipient does not understand &MUST-NOT; attempt to recombine it
     500   with a stored representation. A proxy that receives such a message
     501   &SHOULD; forward it downstream.
     502</t>
     503<t>
     504   For byte ranges, a sender &SHOULD; indicate the complete length of the
     505   representation from which the range has been extracted unless the complete
     506   length is unknown or difficult to determine. An asterisk character ("*") in
     507   place of the complete-length indicates that the representation length was
     508   unknown when the header field was generated.
     509</t>
     510<t>
     511   A Content-Range field value with a <x:ref>byte-range-resp</x:ref> that has
     512   a <x:ref>last-byte-pos</x:ref> value less than its
     513   <x:ref>first-byte-pos</x:ref> value, or a <x:ref>complete-length</x:ref>
     514   value less than or equal to its <x:ref>last-byte-pos</x:ref> value, is
     515   invalid. The recipient of an invalid <x:ref>Content-Range</x:ref> &MUST-NOT;
     516   attempt to recombine the received content with a stored representation.
     517</t>
     518<t>
     519   A server generating a <x:ref>206 (Partial Content)</x:ref> response to a
     520   byte range request &MUST; send, in each body-part of a multipart response
     521   or in the header block of a single part response, a Content-Range header
     522   field containing a <x:ref>byte-range-resp</x:ref> value that reflects the
     523   corresponding range being sent. The following example would apply
     524   when the complete length of the selected representation is known by the
     525   sender to be 1234 bytes:
     526</t>
     527<figure><artwork type="example">
     528  Content-Range: bytes 42-1233/1234
     529</artwork></figure>
     530<t>
     531   or this second example would apply when the complete length is unknown:
     532</t>
     533<figure><artwork type="example">
     534  Content-Range: bytes 42-1233/*
     535</artwork></figure>
     536<t>
     537   A server generating a <x:ref>416 (Range Not Satisfiable)</x:ref> response
     538   to a byte range request &SHOULD; send a Content-Range header field with an
     539   <x:ref>unsatisfied-range</x:ref> value, as in the following example:
     540</t>
     541<figure><artwork type="example">
     542  Content-Range: bytes */1234
     543</artwork></figure>
     544<t>
     545   The complete-length in a 416 response indicates the current length of the
     546   selected representation, which will be known by the server generating the
     547   response because that is how it determined the range to be unsatisfiable.
     548</t>
     549<t>
     550   The "Content-Range" header field has no meaning for status codes that do
     551   not explicitly describe its semantic. For this specification, only the
     552   <x:ref>206 (Partial Content)</x:ref> and
     553   <x:ref>416 (Range Not Satisfiable)</x:ref> status codes describe a meaning
     554   for Content-Range.
     555</t>
     556<t>
     557   More examples of Content-Range values, assuming that the representation
    538558   contains a total of 1234 bytes:
    539559   <list style="symbols">
     
    541561        The first 500 bytes:
    542562<figure><artwork type="example" x:indent-with="   ">
    543   bytes 0-499/1234
     563  Content-Range: bytes 0-499/1234
    544564</artwork></figure>
    545565      </t>   
     
    547567        The second 500 bytes:
    548568<figure><artwork type="example" x:indent-with="   ">
    549   bytes 500-999/1234
     569  Content-Range: bytes 500-999/1234
    550570</artwork></figure>
    551571      </t>   
     
    553573        All except for the first 500 bytes:
    554574<figure><artwork type="example" x:indent-with="   ">
    555   bytes 500-1233/1234
     575  Content-Range: bytes 500-1233/1234
    556576</artwork></figure>
    557577      </t>   
     
    559579        The last 500 bytes:
    560580<figure><artwork type="example" x:indent-with="   ">
    561   bytes 734-1233/1234
     581  Content-Range: bytes 734-1233/1234
    562582</artwork></figure>
    563583      </t>   
     
    766786   retrieval of large representations. A server &MUST; ignore a Range header
    767787   field received with a request method other than GET.
     788</t>
     789<t>
     790   An origin server &MUST; ignore a <x:ref>Range</x:ref> header field that
     791   contains a range unit it does not understand. A proxy &MAY; either discard
     792   a <x:ref>Range</x:ref> header field that contains a range unit it does not
     793   understand or pass it to the next inbound server when forwarding the
     794   request.
    768795</t>
    769796<t>
     
    868895<t>
    869896  The registration procedure for HTTP Range Specifiers is defined by
    870   <xref target="range.specifier.registry"/> of this document.
     897  <xref target="range.unit.registry"/> of this document.
    871898</t>
    872899<t>
     
    13151342<t>
    13161343  This specification introduces a Range Specifier Registry.
    1317   (<xref target="range.specifier.registry"/>)
     1344  (<xref target="range.unit.registry"/>)
    13181345</t>
    13191346</section>
     
    13681395<x:ref>Accept-Ranges</x:ref> = acceptable-ranges
    13691396
    1370 <x:ref>Content-Range</x:ref> = byte-content-range-spec / other-content-range-spec
     1397<x:ref>Content-Range</x:ref> = byte-content-range / other-content-range
    13711398
    13721399<x:ref>HTTP-date</x:ref> = &lt;HTTP-date, defined in [Part2], Section 7.1.1.1&gt;
     
    13811408 range-unit ] ) ) / "none"
    13821409
    1383 <x:ref>byte-content-range-spec</x:ref> = bytes-unit SP byte-range-resp-spec "/" (
    1384  instance-length / "*" )
    1385 <x:ref>byte-range-resp-spec</x:ref> = ( first-byte-pos "-" last-byte-pos ) / "*"
     1410<x:ref>byte-content-range</x:ref> = bytes-unit SP ( byte-range-resp "/"
     1411 unsatisfied-range )
     1412<x:ref>byte-range</x:ref> = first-byte-pos "-" last-byte-pos
     1413<x:ref>byte-range-resp</x:ref> = byte-range "/" ( complete-length / "*" )
    13861414<x:ref>byte-range-set</x:ref> = *( "," OWS ) ( byte-range-spec /
    13871415 suffix-byte-range-spec ) *( OWS "," [ OWS ( byte-range-spec /
     
    13911419<x:ref>bytes-unit</x:ref> = "bytes"
    13921420
     1421<x:ref>complete-length</x:ref> = 1*DIGIT
     1422
    13931423<x:ref>entity-tag</x:ref> = &lt;entity-tag, defined in [Part4], Section 2.3&gt;
    13941424
    13951425<x:ref>first-byte-pos</x:ref> = 1*DIGIT
    13961426
    1397 <x:ref>instance-length</x:ref> = 1*DIGIT
    1398 
    13991427<x:ref>last-byte-pos</x:ref> = 1*DIGIT
    14001428
    1401 <x:ref>other-content-range-spec</x:ref> = other-range-unit SP other-range-resp-spec
    1402 <x:ref>other-range-resp-spec</x:ref> = *CHAR
     1429<x:ref>other-content-range</x:ref> = other-range-unit SP other-range-resp
     1430<x:ref>other-range-resp</x:ref> = *CHAR
    14031431<x:ref>other-range-set</x:ref> = 1*CHAR
    14041432<x:ref>other-range-unit</x:ref> = token
     
    14111439
    14121440<x:ref>token</x:ref> = &lt;token, defined in [Part1], Section 3.2.6&gt;
     1441
     1442<x:ref>unsatisfied-range</x:ref> = "*/" complete-length
    14131443</artwork>
    14141444</figure>
Note: See TracChangeset for help on using the changeset viewer.