<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="12" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[12]</anchor-end> <dfn><code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Content-Range:</anchor></code></dfn> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>は、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">資源</anchor>のうちどの部分が含まれているかを表します。</p><section><h1>仕様書</h1><refs xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><ul xmlns="http://www.w3.org/1999/xhtml"><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[3]</anchor-end> <strong><cite xml:lang="en">RFC 7233 - Hypertext Transfer Protocol (HTTP/1.1): Range Requests</cite> (<time>2014-09-11 09:57:55 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://tools.ietf.org/html/rfc7233#section-4.2">https://tools.ietf.org/html/rfc7233#section-4.2</anchor-external></strong></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="507" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[507]</anchor-end> <cite xml:lang="en">RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</cite> (<time>2014-06-07 01:55:45 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://tools.ietf.org/html/rfc7231#section-4.3.4">https://tools.ietf.org/html/rfc7231#section-4.3.4</anchor-external></li></ul></refs></section><section><h1>意味</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="4" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[4]</anchor-end> <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Content-Range:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>は、 <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">206</anchor></code>
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>において当該<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">メッセージ</anchor>の <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">payload</anchor>、
または当該<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">本体部分</anchor>に含まれる<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">選択された表現</anchor>の範囲を表します <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;3</anchor-internal></src>。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[5]</anchor-end> <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Content-Range:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>は、 <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">416</anchor></code>
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>において<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">選択された表現</anchor>についての情報を提供します <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;3</anchor-internal></src>。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="10" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[10]</anchor-end> それ以外の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">状態符号</anchor>では、意味を持ちません <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;3</anchor-internal></src>。</p></section><section><h1>構文</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="6" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[6]</anchor-end> 値は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">範囲単位</anchor>、 <code class="char"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">SP</anchor></code>、範囲の記述を並べたものです。
範囲の記述は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">範囲単位</anchor>に依存しますが、0文字以上の列とされています。 <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;3</anchor-internal></src></p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[7]</anchor-end> 範囲の記述に使える文字を <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC 7233</anchor> は <code xmlns="http://www.w3.org/1999/xhtml" class="ABNF" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">CHAR</anchor></code>
としていますが <src><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;3</anchor-internal></src>、これは <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC 723x</anchor> のどこでも定義されていません。
<code xmlns="http://www.w3.org/1999/xhtml" class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Range:</anchor></code> との整合性を考慮すると <code xmlns="http://www.w3.org/1999/xhtml" class="ABNF" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">VCHAR</anchor></code>
の誤りで、 <code xmlns="http://www.w3.org/1999/xhtml" class="char"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">U+0021</anchor></code>-<code xmlns="http://www.w3.org/1999/xhtml" class="char"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">U+007E</anchor></code>
と解釈するべきでしょう。 <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC 2616</anchor> <code xmlns="http://www.w3.org/1999/xhtml" class="ABNF" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">CHAR</anchor></code>
だとすると <code xmlns="http://www.w3.org/1999/xhtml" class="char"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">U+0000</anchor></code>-<code xmlns="http://www.w3.org/1999/xhtml" class="char"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">U+00FF</anchor></code>
が認められますが、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">改行</anchor>なども含まれていて不適切です。</comment-p><figure class="railroad"><ol><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">範囲単位</anchor></li><li><code class="charname" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">SP</anchor></code></li><li>*<ol><li><code class="char"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">U+0021</anchor></code>-<code class="char"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">U+007E</anchor></code></li></ol></li></ol></figure><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="8" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[8]</anchor-end> この構文では <code xmlns="http://www.w3.org/1999/xhtml" class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Content-Range:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>の値が<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">範囲単位</anchor>と
<code xmlns="http://www.w3.org/1999/xhtml" class="charname" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">SP</anchor></code> だけで終わることがありますが、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">欄値</anchor>の項にある通り、 <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC 7230</anchor> にある<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>一般の構文に反しています。</comment-p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="11" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[11]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">範囲単位</anchor>依存の構文については、各<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">範囲単位</anchor>の項を参照してください。</comment-p></section><section><h1>文脈</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="14" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[14]</anchor-end> <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">206</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>の場合については、 <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">206</anchor></code>
の項を参照してください。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="15" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[15]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">バイト範囲</anchor>の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">範囲要求</anchor>に対する <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">416</anchor></code>
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>の場合については、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">バイト範囲</anchor>の項を参照してください。</p></section><section><h1>処理</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[9]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">受信者</anchor>は、 <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">206</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>が理解できない<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">範囲単位</anchor>の
<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Content-Range:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>を含んでいる時、
あるいは<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">非妥当</anchor>な範囲の値を含んでいる時、
蓄積された<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">表現</anchor>にこれを結合しようと試みては<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">なりません</strong></anchor>。
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">串</anchor>は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">下流</anchor>へ<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">転送</anchor>する<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">べきです</strong></anchor>。 <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;3</anchor-internal></src></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="13" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[13]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">受信者</anchor>は <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Content-Range:</anchor></code> が含まない範囲の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>を無視するべきと思われますが、
仕様上明記されていません。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="521" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[521]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">起源鯖</anchor>は、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">対象資源</anchor>に <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">PUT</anchor></code> を認めている場合で、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求</anchor>に <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Content-Range:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>が含まれる場合、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">payload</anchor> が一部分しか含まれないのに誤って <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">PUT</anchor></code>
を使っている可能性があるため、 <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">400</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>を送信しなければ<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">なりません</strong></anchor>
<src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="507" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;507</anchor-internal></src>。</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="20" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[20]</anchor-end> この規定は <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC 723x</anchor> で追加されました。</comment-p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="16" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[16]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">範囲要求</anchor>や<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">不完全メッセージ</anchor>も参照。</comment-p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="18" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[18]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Google BigQuery</anchor> <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="17" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;17</anchor-internal></src> や <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">yfrog</anchor> <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="19" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;19</anchor-internal></src>
はファイルの一部のアップロードのために <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">PUT</anchor></code>
で <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Content-Range:</anchor></code> を使っています。</p><refs xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><ul xmlns="http://www.w3.org/1999/xhtml"><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="17" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[17]</anchor-end> <cite xml:lang="ja">Loading Data with a POST Request - Google BigQuery — Google Cloud Platform</cite> (<time>2014-12-18 02:33:03 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://cloud.google.com/bigquery/loading-data-post-request#resume-upload">https://cloud.google.com/bigquery/loading-data-post-request#resume-upload</anchor-external></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="19" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[19]</anchor-end> <cite>yfrog - API</cite> (<time>2014-12-24 15:59:00 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://twitter.yfrog.com/page/api#a9">http://twitter.yfrog.com/page/api#a9</anchor-external></li></ul></refs><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="21" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[21]</anchor-end> この種の <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Web API</anchor> は世間一般でほとんど使われていない <code xmlns="http://www.w3.org/1999/xhtml" class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">PUT</anchor></code>
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">メソッド</anchor>の数少ない正当な利用例だったのに、梯子を外して不適合にしちゃう
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC 723x</anchor> はまじ鬼畜wwwww</comment-p></section><section><h1>歴史</h1><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> RFC 2068 14.17・RFC 2616 14.16 Content-Range</figcaption><blockquote><p>The Content-Range entity-header is sent with a partial entity-body to
specify where in the full entity-body the partial body should be <ins>applied. Range units are defined in section 3.12.</ins> <del>inserted. It also indicates the total size of the full entity-body. When a server returns a partial response to a client, it must describe both the extent of the range covered by the response, and the length of the entire entity-body.</del></p></blockquote><p><code class="HTTP">Content-Range</code> 実体頭欄は、部分 <code class="ABNF"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">entity-body</anchor></code>
と共に送信して、その部分本体が完全 <code class="ABNF">entity-body</code>
のどこに適用されるべきかを指定します。 <ins>範囲単位は 3.12 節で定義しています。</ins> <del>この欄は完全 <code class="ABNF">entity-body</code> の全体の寸法も示します。サーバーが部分応答をクライアントに返す時は、その応答により覆われる範囲と <code class="ABNF">entity-body</code> 全体の長さを記述しなければなりません。</del></p><blockquote><ul><li><code class="ABNF"><dfn>Content-Range</dfn></code> = &quot;Content-Range&quot; &quot;:&quot; content-range-spec]]</li><li><code class="ABNF"><dfn>content-range-spec</dfn> = byte-content-range-spec</code></li><li><del><code class="ABNF"><dfn>byte-content-range-spec</dfn> = bytes-unit <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">SP</anchor> first-byte-pos &quot;-&quot; last-byte-pos &quot;/&quot; entity-length</code></del></li><li><ins><code class="ABNF"><dfn>byte-content-range-spec</dfn> = bytes-unit SP byte-range-resp-spec &quot;/&quot; ( instance-length | &quot;*&quot; )</code></ins></li><li><ins><code class="ABNF"><dfn>byte-range-resp-spec</dfn> = (first-byte-pos &quot;-&quot; last-byte-pos) | &quot;*&quot;</code></ins></li><li><code class="ABNF"><dfn><del>entity-length</del> <ins>instance-length</ins></dfn> = 1*<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">DIGIT</anchor></code></li></ul></blockquote><insert xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><blockquote xmlns="http://www.w3.org/1999/xhtml"><p>The header SHOULD indicate the total length of the full entity-body,
unless this length is unknown or difficult to determine. The asterisk
&quot;*&quot; character means that the instance-length is unknown at the time
when the response was generated.</p></blockquote><p xmlns="http://www.w3.org/1999/xhtml">この頭は完全な <code class="ABNF">entity-body</code> の全体の長さが未知であるか、
又は決定するのが難しい場合を除いては、この長さを示す<strong>べきです</strong>。
星印 <code class="HTTP">*</code> 文字は、その応答が生成された時点で
<code class="ABNF">instance-length</code> が未知であることを意味します。</p></insert><blockquote><p>Unlike byte-ranges-specifier values <ins>(see section 14.35.1)</ins>, a <del>byte-content-range-spec may</del> <ins>byte-range-resp-spec MUST</ins>
only specify one range, and <del>must</del> <ins>MUST</ins> contain absolute byte positions for
both the first and last byte of the range.</p></blockquote><p><code class="ABNF">byte-ranges-specifier</code> 値とは異なり、 
<code class="ABNF">byte-range-resp-spec</code> は一つの範囲だけを指定しなければ<strong>ならず</strong>、
範囲の最初と最後のバイトの絶対バイト位置を含まなければ<strong>なりません</strong>。</p><blockquote><p>A byte-content-range-spec <ins>with a byte-range-resp-spec</ins> whose last-byte-pos value is less than its
first-byte-pos value, or whose <del>entity-length</del> <ins>instance-length</ins> value is less than or
equal to its last-byte-pos value, is invalid. The recipient of an
invalid byte-content-range-spec MUST ignore it and any content
transferred along with it.</p></blockquote><p><code class="ABNF">byte-range-resp-spec</code> つきの <code class="ABNF">byte-content-range-spec</code>
であってその <code class="ABNF">last-byte-pos</code> が
<code class="ABNF">first-byte-pos</code> 値よりも小さなものや、
<code class="ABNF">instance-length</code> 値が <code class="ABNF">last-byte-pos</code>
値以下のものは不当です。不当な <code class="ABNF">byte-content-range-spec</code>
の受信者は、この <code class="ABNF">byte-content-range-spec</code>
及びそれと共に転送された内容を全て無視しなければ<strong>なりません</strong>。</p><insert xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><blockquote xmlns="http://www.w3.org/1999/xhtml"><p>A server sending a response with status code 416 (Requested range not
satisfiable) SHOULD include a Content-Range field with a byte-range-resp-spec 
of &quot;*&quot;. The instance-length specifies the current length of
the selected resource. A response with status code 206 (Partial
Content) MUST NOT include a Content-Range field with a byte-range-resp-spec 
of &quot;*&quot;.</p></blockquote><p xmlns="http://www.w3.org/1999/xhtml">状態符号 <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">416</anchor></code> (要求された範囲は満足されませんでした)
の応答を送信するサーバーは、 <code class="ABNF">byte-range-resp-spec</code>
が <code class="HTTP">*</code> の <code class="HTTP">Content-Range</code>
欄を含める<strong>べきです</strong>。 <code class="ABNF">instance-length</code>
が選択された資源の現在の長さを指定します。
状態符号 <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">206</anchor></code> (部分内容) の応答は
<code class="ABNF">byte-range-resp-spec</code>
が <code class="HTTP">*</code> の <code class="HTTP">Content-Range</code> 欄を含んでいては<strong>なりません</strong>。</p></insert><blockquote><p>Examples of byte-content-range-spec values, assuming that the entity
contains a total of 1234 bytes:</p></blockquote><p>実体が全部で 1234 バイトあるとして、 <code class="ABNF">byte-content-range-spec</code>
値の例を示します:</p><blockquote><dl><dt><del>o</del> <ins>.</ins> The first 500 bytes <ins>最初の500バイト</ins></dt><dd>
bytes 0-499/1234</dd><dt><del>o</del> <ins>.</ins> The second 500 bytes <ins>次の500バイト</ins></dt><dd>
bytes 500-999/1234</dd><dt><del>o</del> <ins>.</ins> All except for the first 500 bytes <ins>最初の500バイト以外全て</ins></dt><dd>
bytes 500-1233/1234</dd><dt><del>o</del> <ins>.</ins> The last 500 bytes <ins>最後の500バイト</ins></dt><dd>
bytes 734-1233/1234</dd></dl></blockquote><blockquote><p>When an HTTP message includes the content of a single range (for
example, a response to a request for a single range, or to a request
for a set of ranges that overlap without any holes), this content is
transmitted with a Content-Range header, and a Content-Length header
showing the number of bytes actually transferred. For example,</p></blockquote><p>単一の範囲の内容を含む HTTP メッセージ (例えば、
単一の範囲の要求への応答又は穴なしに重なり合う範囲の集合の要求への応答)
の場合は、この内容は <code class="HTTP">Content-Range</code> 頭と共に転送され、
<code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Content-Length</anchor></code> 頭は実際に転送されるバイト数を示します。
例えば、</p><blockquote><pre>HTTP/1.1 206 Partial content
Date: Wed, 15 Nov 1995 06:25:24 GMT
Last-modified: Wed, 15 Nov 1995 04:58:08 GMT
Content-Range: bytes 21010-47021/47022
Content-Length: 26012
Content-Type: image/gif</pre><p>When an HTTP message includes the content of multiple ranges (for
example, a response to a request for multiple non-overlapping
ranges), these are transmitted as a multipart <del>MIME</del> message. The
multipart <del>MIME content-type</del> <ins>media type</ins> used for this purpose is <del>defined in this specification to be &quot;multipart/byteranges&quot;</del> <ins>&quot;multipart/byteranges&quot; as defined in appendix 19.2</ins>. See appendix <del>19.2 for its definition</del> <ins>19.6.3 for a compatibility issue</ins>.</p></blockquote><p>HTTP メッセージが複数の範囲を含む場合 (例えば、
複数の重なり合わない範囲の要求への応答) には、
複数部分メッセージとして転送されます。
この目的で使う複数部分媒体型は附属書 19.2 節で定義している
<code class="MIME"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">multipart/byterange</anchor></code> です。互換性の問題については附属書
19.6.3 節を参照してください。</p><blockquote><p><ins>A response to a request for a single range MUST NOT be sent using the multipart/byteranges media type.  A response to a request for multiple ranges, whose result is a single range, MAY be sent as a multipart/byteranges media type with one part.</ins> A client that cannot
decode a <del>MIME</del> multipart/byteranges message <del>should not</del> <ins>MUST NOT</ins> ask for multiple
byte-ranges in a single request.</p></blockquote><p>単一の範囲の要求への応答は <code class="MIME">multipart/byterange</code>
媒体型を使って送っては<strong>なりません</strong>。
複数範囲の要求への応答であってその結果が単一範囲であるものは、
1つの部分の <code class="MIME">multipart/byterange</code>
媒体型で送っても<strong>構いません</strong>。
<code class="MIME">multipart/byterange</code> メッセージを復号できないクライアントは、
複数の <code class="ABNF">byte-range</code> を単一の要求で依頼しては<strong>なりません</strong>。</p><blockquote><p>When a client requests multiple byte-ranges in one request, the
server SHOULD return them in the order that they appeared in the
request.</p></blockquote><p>クライアントが複数の <code class="ABNF">byte-range</code> 
を1つの要求で要求した時は、サーバーは要求中に出現した順でこれを返す<strong>べきです</strong>。</p><blockquote><p>If the server ignores a byte-range-spec because it is <ins>syntactically</ins> invalid, the
server <del>should</del> <ins>SHOULD</ins> treat the request as if the invalid Range header field
did not exist. (Normally, this means return a 200 response containing
the full entity). <del>The reason is that the only time a client will make such an invalid request is when the entity is smaller than the entity retrieved by a prior request.</del></p></blockquote><p><code class="ABNF">byte-range-spec</code> が構文的に不当であるためにサーバーがこれを無視する場合は、
サーバーは要求に不当な <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Range</anchor></code> 頭欄が存在しなかったものとして扱う<strong>べきです</strong>。
(通常、これは完全な実体を含んだ <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">200</anchor></code>
応答を返すことを意味します。) <del>理由は、クライアントがそのような不当な要求を作るのは実態が以前の要求で取り出された実体より小さい時だけだからです。</del></p><insert xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><blockquote xmlns="http://www.w3.org/1999/xhtml"><p>If the server receives a request (other than one including an 
If-Range request-header field) with an unsatisfiable Range 
request-header field (that is, all of whose byte-range-spec values have a
first-byte-pos value greater than the current length of the selected
resource), it SHOULD return a response code of 416 (Requested range
not satisfiable) (section 10.4.17).</p></blockquote><p xmlns="http://www.w3.org/1999/xhtml">サーバーが (<code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">If-Range</anchor></code> 要求頭欄を含んでいない) 
満足されない <code class="HTTP">Range</code> 要求頭欄
(つまり、 <code class="ABNF">byte-range-spec</code> 値の全てにおいて <code class="ABNF">first-byte-pos</code> 値が選択された資源の現在の長さよりも大きいもの。) を持った要求を受け取ったときには、
サーバーは応答符号 <code class="HTTP">416</code> (要求された範囲は満足されませんでした)
を返す<strong>べきです</strong>。</p><blockquote xmlns="http://www.w3.org/1999/xhtml"><p>Note: clients cannot depend on servers to send a 416 (Requested
range not satisfiable) response instead of a 200 (OK) response for
an unsatisfiable Range request-header, since not all servers
implement this request-header.</p></blockquote><p xmlns="http://www.w3.org/1999/xhtml">注意 : 全てのサーバーはこの要求頭を実装しているわけではありませんから、
クライアントは満足されない <code class="HTTP">Range</code> 要求頭欄にサーバーが 
<code class="HTTP">200</code> (OK) 応答ではなく <code class="HTTP">416</code>
(要求された範囲は満足されませんでした)
応答が送ることに依存することはできません。</p></insert></figure><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> 参照しろと書いてある  RFC 2616 19.6.3 (RFC 2068 からの変更点) にはたいして面白いことは書いてありませんでした。</p><refs xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><ul xmlns="http://www.w3.org/1999/xhtml"><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> <cite xml:lang="en">draft-wood-dtnrg-http-dtn-delivery-07 - Using HTTP for delivery in Delay/Disruption-Tolerant Networks</cite>
( (<time>2012-02-26 11:11:35 +09:00</time> 版))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://tools.ietf.org/html/draft-wood-dtnrg-http-dtn-delivery-07#page-6">http://tools.ietf.org/html/draft-wood-dtnrg-http-dtn-delivery-07#page-6</anchor-external></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="522" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[522]</anchor-end> <cite>api - Content-Range header - allowed units? - Stack Overflow</cite>
( (<time>2014-09-17 03:04:52 +09:00</time> 版))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://stackoverflow.com/questions/9480193/content-range-header-allowed-units">http://stackoverflow.com/questions/9480193/content-range-header-allowed-units</anchor-external></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="523" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[523]</anchor-end> <cite><strong></strong>[<strong></strong>#JENKINS-13125<strong></strong>]<strong></strong> HTTP Content-Range Header one byte past file length and missing &quot;bytes&quot; unit - Jenkins JIRA</cite>
( (<time>2014-09-17 03:20:04 +09:00</time> 版))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://issues.jenkins-ci.org/browse/JENKINS-13125">https://issues.jenkins-ci.org/browse/JENKINS-13125</anchor-external></li></ul></refs><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="23" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[23]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">WebDAV</anchor> の <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">MS</anchor> の拡張には
<dfn><code>DAV:contentrange</code></dfn>
があります。
<src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="22" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;22</anchor-internal></src></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="22" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[22]</anchor-end> <cite><strong>[</strong>MS-XWDSEARCH<strong>]</strong>.pdf</cite>, <time>2018-10-13T16:09:45.000Z</time>, <time>2023-12-02T07:12:25.169Z</time> <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://download.microsoft.com/download/5/0/1/501ED102-E53F-4CE0-AA6B-B0F93629DDC6/Exchange/%5BMS-XWDSEARCH%5D.pdf#page=10">https://download.microsoft.com/download/5/0/1/501ED102-E53F-4CE0-AA6B-B0F93629DDC6/Exchange/%5BMS-XWDSEARCH%5D.pdf#page=10</anchor-external></p></section></body></html>