#?SuikaWiki/0.9 page-icon="HTTP" [2] [[HTTP]] でプロトコルの版を示すために使われる部分が [CODE(ABNF)[HTTP-Version]] で、例えば [SAMP(HTTP)[HTTP/1.1]] のように斜線で区切ってプロトコル名とプロトコル版を並べた文字列になっています。 HTTP メッセージには (古の [[HTTP/0.9]] を除いて) 必ず [CODE(ABNF)[HTTP-Version]] が最初の行に入ることになっています。 受信側はこれを見てどう返答するのかを決めることになります。 [2] HTTP 派生プロトコルである [[RTSP]] や [[SIP]] でも同じものがあります。ここでは [CODE(ABNF)[RTSP-Version]] や [CODE(ABNF)[SIP-Version]] もあわせて取扱います。 [3] 関連プロトコルでも [CODE(ABNF)[[VAR[*]]-Version]] を使うことがあります。例えば、 [[CGI]] で使われる[[メタ変数]] [CODE(CGI)[[[SERVER_PROTOCOL]]]] は受信したメッセージの [CODE(ABNF)[[VAR[*]]-Version]] になります。 斜線を使って名前と版を区切る方法は、 HTTP や関連プロトコルの他のプロトコル要素、例えば [CODE(HTTP)[[[User-Agent]]:]] 欄や [CODE(HTTP)[[[Upgrade]]:]] 欄や [CODE(CGI)[[[GATEWAY_PROTOCOL]]]] メタ変数と共通しています。 [[#comment]] * 大文字と小文字の区別 [8] HTTP では で大文字と小文字を区別''する''旨が追記されています。 ところがすべての RFC でこの点には言及されていません。 しかも [[ABNF]] の規定 (2.1) により、 この部分の大文字・小文字は区別しないことになっていました。 [9] 実装の方はといいますと、 [[Apache]] は小文字のにも対応しています。 [WEAK[適当なプロトコル名を入れると [CODE(HTTP)[[[400]] Bad Request]] になりますが、 [CODE(HTTP)[http/1.0]] とか入れてもそうはなりません。]] 他の実装の中にはきっと小文字だと受け付けないものもあるのでしょう。 [10] RTSP はこの点では完全に HTTP (RFC 2068) 参照なので、 大文字・小文字も両方きっと使えるんだろうなーという状態です。 [11] SIP は RFC 3261 で大文字・小文字を区別''しない''が、 出力の際は必ず大文字にしないと'''いけない'''といっています。 [WEAK[この規定が一番妥当な線ですよね。]] [[#comment]] * 仕様書から **RFC 1945 (HTTP/1.0); RFC 2068・2616 (HTTP/1.1) 3.1 HTTP Version [1] > HTTP uses a "." numbering scheme to indicate versions of the protocol. The protocol versioning policy is intended to allow the sender to indicate the format of a message and its capacity for understanding further HTTP communication, rather than the features obtained via that communication. No change is made to the version number for the addition of message components which do not affect communication behavior or which only add to extensible field values. The number is incremented when the changes made to the protocol add features which do not change the general message parsing algorithm, but which may add to the message semantics and imply additional capabilities of the sender. The number is incremented when the format of a message within the protocol is changed. [INS[[INS[{2616}]] See RFC 2145 [36] for a fuller explanation.]] HTTP はプロトコルの判を示すために [CODE[[VAR[]].[VAR[]]]] という番号付け方式を使います。プロトコル版付け方針は、 その通信を通して得られる特徴を示すものというよりは、 送信者がメッセージの書式と以降の HTTP 通信を理解する能力を示すことができるようにするものです。 通信動作に影響しないメッセージ部品や拡張可能な欄値を追加するだけのメッセージ部品の追加によっては版番号は変わりません。 [VAR[]] 番号は、プロトコルに行われた変更がメッセージの意味を追加し、送信者の追加の能力を暗示しても、 一般メッセージ解析算法は変更しない特徴を加える時に増やします。 [VAR[]] 番号はプロトコル中のメッセージの書式が変更された時に増やします。 [INS[より完全な説明は [[RFC2145]] を見て下さい。]] > The version of an HTTP message is indicated by an HTTP-Version field in the first line of the message. [DEL[[INS[{1945}]] If the protocol version is not specified, the recipient must assume that the message is in the simple HTTP/0.9 format.]] [INS[[INS[{errata}]] HTTP-Version is case-sensitive.]] HTTP メッセージの版はメッセージの最初の行の [CODE(ABNF)[HTTP-Version]] 欄で示します。 [DEL[プロトコルの版が示されていない時は、受信者はそのメッセージが単純 HTTP/0.9 書式であると仮定しなければなりません。]] [INS[[CODE(ABNF)[HTTP-Version]] は大文字・小文字を区別しません。]] > -HTTP-Version = "HTTP" "/" 1*DIGIT "." 1*DIGIT > Note that the major and minor numbers [DEL[[INS[{1945}]] should]] [INS[MUST]] be treated as separate integers and that each [DEL[may]] [INS[[INS[{2616}]] MAY]] be incremented higher than a single digit. Thus, HTTP/2.4 is a lower version than HTTP/2.13, which in turn is lower than HTTP/12.3. Leading zeros [DEL[[INS[{1945}]] should]] [INS[MUST]] be ignored by recipients and [DEL[[INS[{1945}]] never generated by senders]] [INS[MUST NOT be sent]]. 大番号と小番号は別の整数として扱[DEL[うべきです]][INS[わなければ'''なりません''']]し、 それぞれの番号は単一の数字よりも大きく増やしても'''構いません'''。 従って、 [CODE(HTTP)[HTTP/2.4]] は [CODE(HTTP)[HTTP/2.13]] よりも小さな版で、 [CODE(HTTP)[HTTP/2.13]] は [CODE(HTTP)[HTTP/12.3]] よりも小さな版です。受信者は先行する零を無視[DEL[するべきです]][INS[しなければ'''なりません''']]し、 送信者は送信しては'''なりません'''。 > [DEL[[INS[{1945}]] This document defines both the 0.9 and 1.0 versions of the HTTP protocol.]] [DEL[[INS[{1945,2068}]] Applications sending [DEL[[INS[{1945}]] Full-]]Request or [DEL[[INS[{1945}]] Full-]]Response messages, as defined by this specification, [DEL[[INS[{1945}]] must]] [INS[MUST]] include an HTTP-Version of [DEL["HTTP/1.0"]] [INS["HTTP/1.1"]]. [INS[[INS[{2068}]] Use of this version number indicates that the sending application is at least conditionally compliant with this specification.]] ]] [INS[An application that sends a request or response message that includes HTTP-Version of "HTTP/1.1" MUST be at least conditionally compliant with this specification. Applications that are at least conditionally compliant with this specification SHOULD use an HTTP-Version of "HTTP/1.1" in their messages, and MUST do so for any message that is not compatible with HTTP/1.0. For more details on when to send specific HTTP-Version values, see RFC 2145 [36].]] ;[DEL[この文書は HTTP プロトコルの 0.9 と 1.0 の2つの版を定義します。]] [DEL[この仕様書で定義する通り [CODE(ABNF)[Request]] メッセージや [CODE(ABNF)[Response]] メッセージを送信する応用は、 [DEL[[CODE(HTTP)[HTTP/1.0]]]] [INS[[CODE(HTTP)[HTTP/1.1]]]] の [CODE(ABNF)[HTTP-Version]] を含めなければ'''なりません'''。 [INS[この版番号を使用することは、送信する応用がこの仕様書に少なくても条件的には適合することを示します。]]]] [INS[[CODE(HTTP)[HTTP/1.1]] の [CODE(ABNF)[HTTP-Version]] を含んだ要求メッセージまたは応答メッセージを送信する応用は、この仕様書に少なくても条件的に適合しなければ'''なりません'''。この仕様書に少なくても条件的に適用する応用は、そのメッセージで [CODE(HTTP)[HTTP/1.1]] の [CODE(ABNF)[HTTP-Version]] を使用する'''べきです'''し、 HTTP/1.0 と互換ではないメッセージにはそうしなければ'''なりません'''。いつ特定の [CODE(ABNF)[HTTP-Version]] 値を送信するかについてより詳しくは [[RFC2145]] を見て下さい。]] [DEL[ >[INS[{1945}]] HTTP/1.0 servers must: - o recognize the format of the Request-Line for HTTP/0.9 and HTTP/1.0 requests; - o understand any valid request in the format of HTTP/0.9 or HTTP/1.0; - o respond appropriately with a message in the same protocol version used by the client. HTTP/1.0 サーバーは、 - HTTP/0.9 要求と HTTP/1.0 要求の [CODE(ABNF)[Request-Line]] 書式を認識しなければなりません。 - HTTP/0.9 や HTTP/1.0 の書式の妥当な要求を理解しなければなりません。 - クライアントが使用しているのと同じプロトコル版のメッセージで適切に応答しなければなりません。 > HTTP/1.0 clients must: - o recognize the format of the Status-Line for HTTP/1.0 responses; - o understand any valid response in the format of HTTP/0.9 or HTTP/1.0. HTTP/1.0 クライアントは、 - HTTP/1.0 応答の [CODE(ABNF)[Status-Line]] の書式を認識しなければなりません。 - HTTP/0.9 や HTTP/1.0 の書式の妥当な応答を理解しなければなりません。 ]DEL] [INS[ >[INS[{2068,2616}]] The HTTP version of an application is the highest HTTP version for which the application is at least conditionally compliant. 応用の HTTP 版は、その応用が少なくても条件付で適合する最高の HTTP 版です。 ]INS] > Proxy and gateway applications [DEL[[INS[{1945,2068}]] must]] [INS[[INS[{2616}]] need to]] be careful [DEL[in]] [INS[when]] forwarding [DEL[[INS[{1945}]] requests that are received]] [INS[messages]] in [DEL[[INS[{1945}]] a format]] [INS[protocol versions]] different from that of the application[DEL['s [INS[{1945}]] native HTTP version]]. Since the protocol version indicates the protocol capability of the sender, a proxy/gateway [DEL[[INS[{1945}]] must]] [INS[[INS[{2068,2616}]] MUST]] [DEL[[INS[{1945,2068}]] never]] [INS[[INS[{2616}]] NOT]] send a message with a version indicator which is greater than its [DEL[[INS[{1945}]] native]] [INS[actual]] version[DEL[; if]] [INS[. [INS[{2616}]] If]] a higher version request is received, the proxy/gateway [DEL[[INS[{1945}]] must]] [INS[MUST]] either downgrade the request version [DEL[[INS[{1945}]] or]][INS[, [INS[{2068,2616}]]]] [INS[[INS[{2616}]] or]] respond with an error[INS[, [INS[{2068,2616}]] or switch to tunnel behavior]]. [DEL[[INS[{1945,2068}]] Requests with a version lower than that of the [DEL[[INS[{1945}]] application's native format may]] [INS[proxy/gateway's version MAY]] be upgraded before being forwarded; the proxy/gateway's response to that request [DEL[[INS[{1945}]] must follow the server requirements listed above]] [INS[MUST be in the same major version as the request]].]] 串応用および関門応用は、応用の HTTP 版と異なるプロトコル版のメッセージを転送するときに用心する必要があります。 プロトコル版は送信者のプロトコル能力を示しますから、串・関門はその実際の版よりも大きな版識別子を持ったメッセージを送信しては'''なりません'''。 より大きな版の要求を受信した場合は、串・関門は要求の版を降下させるか、誤りで応答するか[INS[、またはトンネル動作に切り替えるか]]しなければ'''なりません'''。 [DEL[串・関門の版より小さな版の要求は転送の前に版を向上させても'''構いません'''。その要求に対する串・関門の応答は[DEL[上述のサーバーの要件に従わなければなりません]][INS[要求と同じ大版でなければ'''なりません''']]。]] [INS[ >[INS[{2616}]] Due to interoperability problems with HTTP/1.0 proxies discovered since the publication of RFC 2068[33], caching proxies MUST, gateways MAY, and tunnels MUST NOT upgrade the request to the highest version they support. The proxy/gateway's response to that request MUST be in the same major version as the request. RFC 2068 の出版後に発見された HTTP/1.0 串との互換性の相互運用性の問題のため、 要求を対応している最高の版に向上させることを、キャッシュ串は行わなければ'''ならず'''、 関門はしても'''構いません'''が、トンネルは行っては'''なりません'''。 その要求に対する串・関門の応答は要求と同じ大版でなければ'''なりません'''。 ]INS] [INS[ >[INS[{2068,2616}]] Note: Converting between versions of HTTP may involve modification of header fields required or forbidden by the versions involved. 注意 : HTTP の版間の変換は、その版が必須としていたり禁止指定いたりする頭欄の編集を行うこととなるかもしれません。 ]INS] ** RFC 2145 (HTTP 版番号) [7] [[RFC2145]] は HTTP の版番号の解釈についてまとめた RFC です。 **RFC 2326 (RTSP/1.0) 3.1 RTSP Version [3] > [H3.1] applies, with HTTP replaced by RTSP. [CODE(HTTP)[HTTP]] を [CODE(HTTP)[RTSP]] に置換した上で RFC 2068 3.1 節を適用します。 ** RFC 2543 (SIP/2.0) [4] [CODE(ABNF)[SIP-Version]] の定義が全く欠落しています。 ** RFC 3261 (SIP/2.0) 7.1 (抜粋) [5] > SIP-Version: Both request and response messages include the version of SIP in use, and follow [H3.1] (with HTTP replaced by SIP, and HTTP/1.1 replaced by SIP/2.0) regarding version ordering, compliance requirements, and upgrading of version numbers. To be compliant with this specification, applications sending SIP messages MUST include a SIP-Version of "SIP/2.0". The SIP-Version string is case-insensitive, but implementations MUST send upper-case. > Unlike HTTP/1.1, SIP treats the version number as a literal string. In practice, this should make no difference. 要求メッセージと応答メッセージは、使用する SIP の版を含み、版順序付け、適合要件、版番号の向上について RFC 2616 3.1 節を ([CODE[HTTP]] を [CODE[SIP]] に、 [CODE[HTTP/1.1]] を [CODE[SIP/2.0]] に置換して) 従います。 この仕様書に適合するためには、 SIP メッセージを送信する応用は [CODE(ABNF)[SIP-Version]] として [CODE(SIP)[SIP/2.0]] を含めなければ'''なりません'''。 [CODE(ABNF)[SIP-Version]] 文字列は大文字・小文字を区別しませんが、 実装は大文字で送らなければ'''なりません'''。 HTTP/1.1 とは異なり、 SIP は版番号を表記文字列として扱います。 実際上、これは何の違いもありません。 ** RFC 3261 (SIP/2.0) ABNF 抜粋 [6] > - [CODE(ABNF)[SIP-Version = "SIP" "/" 1*DIGIT "." 1*DIGIT]] ** RFC の部分の License [[RFCのライセンス]] * メモ