Ignore:
Timestamp:
20/01/13 16:26:24 (7 years ago)
Author:
fielding@…
Message:

(editorial) move byte range examples closer to defs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • draft-ietf-httpbis/latest/p5-range.html

    r2144 r2145  
    674674         at zero.
    675675      </p>
    676       <p id="rfc.section.2.1.p.6">If the last-byte-pos value is present, it <em class="bcp14">MUST</em> be greater than or equal to the first-byte-pos in that byte-range-spec, or the byte-range-spec is syntactically invalid. The
    677          recipient of a byte-range-set that includes one or more syntactically invalid byte-range-spec values <em class="bcp14">MUST</em> ignore the header field that includes that byte-range-set.
    678       </p>
    679       <p id="rfc.section.2.1.p.7">If the last-byte-pos value is absent, or if the value is greater than or equal to the current length of the representation
    680          data, last-byte-pos is taken to be equal to one less than the current length of the representation in bytes.
    681       </p>
    682       <p id="rfc.section.2.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>
    683       <div id="rfc.figure.u.4"></div><pre class="inline"><span id="rfc.iref.g.11"></span><span id="rfc.iref.g.12"></span>  <a href="#rule.ranges-specifier" class="smpl">suffix-byte-range-spec</a> = "-" <a href="#rule.ranges-specifier" class="smpl">suffix-length</a>
    684   <a href="#rule.ranges-specifier" class="smpl">suffix-length</a> = 1*<a href="#imported.abnf" class="smpl">DIGIT</a>
    685 </pre><p id="rfc.section.2.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
    686          value. (That is, this form specifies the last N bytes of a representation.) If the representation is shorter than the specified
    687          suffix-length, the entire representation is used.
    688       </p>
    689       <p id="rfc.section.2.1.p.11">If a syntactically valid byte-range-set includes at least one byte-range-spec whose first-byte-pos is less than the current
    690          length of the representation, or at least one suffix-byte-range-spec with a non-zero suffix-length, then the byte-range-set
    691          is satisfiable. Otherwise, the byte-range-set is unsatisfiable. If the byte-range-set is unsatisfiable, the server <em class="bcp14">SHOULD</em> send a response with a <a href="#status.416" class="smpl">416 (Range Not Satisfiable)</a> status code. Otherwise, the server <em class="bcp14">SHOULD</em> send a response with a <a href="#status.206" class="smpl">206 (Partial Content)</a> status code containing the satisfiable ranges of the representation.
    692       </p>
    693       <p id="rfc.section.2.1.p.12">In the byte range syntax, <a href="#rule.ranges-specifier" class="smpl">first-byte-pos</a>, <a href="#rule.ranges-specifier" class="smpl">last-byte-pos</a>, and <a href="#rule.ranges-specifier" class="smpl">suffix-length</a> are expressed as decimal number of octets. Since there is no predefined limit to the length of an HTTP payload, recipients <em class="bcp14">SHOULD</em> anticipate potentially large decimal numerals and prevent parsing errors due to integer conversion overflows.
    694       </p>
    695       <p id="rfc.section.2.1.p.13">Examples of byte-ranges-specifier values (assuming a representation of length 10000): </p>
     676      <p id="rfc.section.2.1.p.6">Examples of byte-ranges-specifier values: </p>
    696677      <ul>
    697678         <li>The first 500 bytes (byte offsets 0-499, inclusive):
    698             <div id="rfc.figure.u.5"></div><pre class="text">  bytes=0-499
     679            <div id="rfc.figure.u.4"></div><pre class="text">  bytes=0-499
    699680</pre> </li>
    700681         <li>The second 500 bytes (byte offsets 500-999, inclusive):
    701             <div id="rfc.figure.u.6"></div><pre class="text">  bytes=500-999
     682            <div id="rfc.figure.u.5"></div><pre class="text">  bytes=500-999
    702683</pre> </li>
     684      </ul>
     685      <p id="rfc.section.2.1.p.7">If the last-byte-pos value is present, it <em class="bcp14">MUST</em> be greater than or equal to the first-byte-pos in that byte-range-spec, or the byte-range-spec is syntactically invalid. The
     686         recipient of a byte-range-set that includes one or more syntactically invalid byte-range-spec values <em class="bcp14">MUST</em> ignore the header field that includes that byte-range-set.
     687      </p>
     688      <p id="rfc.section.2.1.p.8">If the last-byte-pos value is absent, or if the value is greater than or equal to the current length of the representation
     689         data, last-byte-pos is taken to be equal to one less than the current length of the representation in bytes.
     690      </p>
     691      <p id="rfc.section.2.1.p.9">By its choice of last-byte-pos, a client can limit the number of bytes retrieved without knowing the size of the representation.</p>
     692      <div id="rfc.figure.u.6"></div><pre class="inline"><span id="rfc.iref.g.11"></span><span id="rfc.iref.g.12"></span>  <a href="#rule.ranges-specifier" class="smpl">suffix-byte-range-spec</a> = "-" <a href="#rule.ranges-specifier" class="smpl">suffix-length</a>
     693  <a href="#rule.ranges-specifier" class="smpl">suffix-length</a> = 1*<a href="#imported.abnf" class="smpl">DIGIT</a>
     694</pre><p id="rfc.section.2.1.p.11">A suffix-byte-range-spec is used to specify the suffix of the representation data, of a length given by the suffix-length
     695         value. (That is, this form specifies the last N bytes of a representation.) If the representation is shorter than the specified
     696         suffix-length, the entire representation is used. For example (assuming a representation of length 10000):
     697      </p>
     698      <ul>
    703699         <li>The final 500 bytes (byte offsets 9500-9999, inclusive):
    704700            <div id="rfc.figure.u.7"></div><pre class="text">  bytes=-500
     
    713709</pre> </li>
    714710      </ul>
     711      <p id="rfc.section.2.1.p.12">If a syntactically valid byte-range-set includes at least one byte-range-spec whose first-byte-pos is less than the current
     712         length of the representation, or at least one suffix-byte-range-spec with a non-zero suffix-length, then the byte-range-set
     713         is satisfiable. Otherwise, the byte-range-set is unsatisfiable. If the byte-range-set is unsatisfiable, the server <em class="bcp14">SHOULD</em> send a response with a <a href="#status.416" class="smpl">416 (Range Not Satisfiable)</a> status code. Otherwise, the server <em class="bcp14">SHOULD</em> send a response with a <a href="#status.206" class="smpl">206 (Partial Content)</a> status code containing the satisfiable ranges of the representation.
     714      </p>
     715      <p id="rfc.section.2.1.p.13">In the byte range syntax, <a href="#rule.ranges-specifier" class="smpl">first-byte-pos</a>, <a href="#rule.ranges-specifier" class="smpl">last-byte-pos</a>, and <a href="#rule.ranges-specifier" class="smpl">suffix-length</a> are expressed as decimal number of octets. Since there is no predefined limit to the length of an HTTP payload, recipients <em class="bcp14">SHOULD</em> anticipate potentially large decimal numerals and prevent parsing errors due to integer conversion overflows.
     716      </p>
    715717      <h2 id="rfc.section.2.2"><a href="#rfc.section.2.2">2.2</a>&nbsp;<a id="range.units.other" href="#range.units.other">Other Range Units</a></h2>
    716718      <p id="rfc.section.2.2.p.1">Range units are intended to be extensible. New range units ought to be registered with IANA, as defined in <a href="#range.unit.registry" title="Range Unit Registry">Section&nbsp;5.1</a>.
Note: See TracChangeset for help on using the changeset viewer.