<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="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> <dfn><code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">426</anchor></code></dfn> (<dfn><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Upgrade Required</anchor></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="428" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[428]</anchor-end> <strong><cite xml:lang="en">RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</cite> (<time>2014-08-07 05:54:02 +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-6.5.15">https://tools.ietf.org/html/rfc7231#section-6.5.15</anchor-external></strong></li><li><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> <cite xml:lang="en">RFC 7230 - Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</cite> (<time>2014-06-07 01:59: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="https://tools.ietf.org/html/rfc7230#page-58">https://tools.ietf.org/html/rfc7230#page-58</anchor-external></li><li><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> <cite xml:lang="en">RFC 6455 - The WebSocket Protocol</cite> (<time>2015-03-11 20:42:50 +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/rfc6455#section-4.2.2">http://tools.ietf.org/html/rfc6455#section-4.2.2</anchor-external></li></ul></refs></section><section><h1>意味</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="429" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[429]</anchor-end> <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">426</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="428" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;428</anchor-internal></src>。</p></section><section><h1>構文</h1><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> <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:">426</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:">Upgrade:</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:"><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="4" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;4</anchor-internal>, <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="428" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;428</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:">WebSocket接続の確立</anchor>時に<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求</anchor>で <code><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Sec-WebSocket-Version:</anchor> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">13</anchor></code> 
以外が指定された場合には、 <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">426</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:">Sec-WebSocket-Version:</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="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;9</anchor-internal></src>。</p></section><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> <cite xml:lang="en">draft-ietf-tip-usehttp-01 - Using the Transaction Internet Protocol (TIP) with HTTP</cite>
( (<time>1998-01-30</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-ietf-tip-usehttp-01#page-4">http://tools.ietf.org/html/draft-ietf-tip-usehttp-01#page-4</anchor-external></li></ul></refs><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="427" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[427]</anchor-end> <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> は <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">426</anchor></code> 「Abort」を提案していましたが、支持を集められなかったようです。</p><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> 現在の <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">426</anchor></code> は、 <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC 2817</anchor>
(<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Upgrade:</anchor> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">TLS/1.0</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="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> <cite xml:lang="en">RFC 2817 - Upgrading to TLS Within HTTP/1.1</cite> (<time>2012-01-09 20:05:09 +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/rfc2817#section-4.2">http://tools.ietf.org/html/rfc2817#section-4.2</anchor-external></li><li><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> <cite xml:lang="en">RFC 2817 - Upgrading to TLS Within HTTP/1.1</cite> (<time>2015-02-22 14:29:05 +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/rfc2817#section-6">http://tools.ietf.org/html/rfc2817#section-6</anchor-external></li></ul></refs><p><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 7231</anchor> により <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC 2817</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>の規定は改訂されました。</p></section><section><h1>関連</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="430" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[430]</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:">101</anchor></code> とは違って、
<code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">426</anchor></code> は切り替えが必要なことを表しているだけです。
<code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">426</anchor></code> は元々の<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="14" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[14]</anchor-end> <time>2020-09-09T06:02:48.00Z</time></p><pre class="code">$ telnet trello.com 80
Trying 18.136.214.18...
Connected to trello.com.
Escape character is '^]'.
GET / HTTP/1.0

HTTP/1.1 426 Upgrade Required
date: Wed, 09 Sep 2020 06:02:08 GMT
server: envoy
connection: close
content-length: 0

Connection closed by foreign host.</pre><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> <code xmlns="http://www.w3.org/1999/xhtml">Upgrade:</code> が指定されていないので違反。</comment-p><pre class="code">$ telnet trello.com 80
Trying 18.136.214.19...
Connected to trello.com.
Escape character is '^]'.
GET /

HTTP/1.1 426 Upgrade Required
date: Wed, 09 Sep 2020 06:03:15 GMT
server: envoy
connection: close
content-length: 0

Connection closed by foreign host.</pre><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="15" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[15]</anchor-end> 本来 <code xmlns="http://www.w3.org/1999/xhtml">GET /</code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">改行</anchor>、
で<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HTTP/0.9応答</anchor>を返さないといけないが、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">改行</anchor>が2回ないと<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="17" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[17]</anchor-end> 
<time>2026-01-02T09:46:47.000Z</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://www.samba.org/">https://www.samba.org/</anchor-external></p><blockquote><pre>GET / HTTP/1.1\x0D
Host: www.samba.org\x0D
Connection: keep-alive\x0D
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:143.0) Gecko/20100101 Firefox/143.0\x0D
Accept: */*\x0D
Accept-Language: en-US\x0D
\x0D
HTTP/1.1 426 Upgrade Required
upgrade: HTTP/2
connection: upgrade
content-length: 16
content-type: text/plain
alt-svc: h3=&quot;:443&quot;; ma=999999; persistent=1

Upgrade Required</pre></blockquote><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-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> のサーバーはすごく厳しくて、 <code>User-Agent:</code> が古めの
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Webブラウザー</anchor>のときは <code>403</code>,
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">プロトコルの版</anchor>が <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HTTP/1.0</anchor> だと <code>403</code>
になります。</p></section><section><h1>メモ</h1><p><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> <cite xml:lang="en">HTTP 1.1 426 Upgrade Required</cite>
(<time>2020-09-09T06:02:22.000Z</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://community.atlassian.com/t5/Trello-discussions/HTTP-1-1-426-Upgrade-Required/td-p/1461934">https://community.atlassian.com/t5/Trello-discussions/HTTP-1-1-426-Upgrade-Required/td-p/1461934</anchor-external></p><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> <cite>2020年8月末頃から Trello API 経由のデータ取得が失敗する | Qrunch(クランチ)</cite>
(<time>2020-09-09T06:02:27.000Z</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://qrunch.net/@armband/entries/opOrB1EoTmxEayqj?ref=qrunch">https://qrunch.net/@armband/entries/opOrB1EoTmxEayqj?ref=qrunch</anchor-external></p></section></body></html>