*6.1.5. Protocol-Specific Metavariables (プロトコル規定メタ変数) (CGI/1.1 draft 03) These metavariables are specific to the protocol via which the request is made. Interpretation of these variables depends on the value of the SERVER_PROTOCOL metavariable (see section 6.1.17). このメタ変数群は、要求が送られてきたプロトコルにより決まります。 この変数群の解釈は [[SERVER_PROTOCOL]] メタ変数 (第6.1.17節を参照) の値によります。 Metavariables with names beginning with "HTTP_" contain values from the request header, if the scheme used was HTTP. Each HTTP header field name is converted to upper case, has all occurrences of "-" replaced with "_", and has "HTTP_" prepended to form the metavariable name. Similar transformations are applied for other protocols. The header data MAY be presented as sent by the client, or MAY be rewritten in ways which do not change its semantics. If multiple header fields with the same field-name are received then the server MUST rewrite them as though they had been received as a single header field having the same semantics before being represented in a metavariable. Similarly, a header field that is received on more than one line MUST be merged into a single line. The server MUST, if necessary, change the representation of the data (for example, the character set) to be appropriate for a CGI metavariable. 「HTTP_」で始まる名前のメタ変数は、使われた方式が HTTP である場合に、 要求頭から取られます。各 HTTP 頭領域名を大文字に変換して、 「-」が含まれれば全て「_」に置き換えて、「HTTP_」を頭につけたのが メタ変数名になります。同様の変換を他のプロトコルについても行います。 頭データはクライアントから送られてきたものを使っても'''良い'''ですし、 意味を変えない範囲で書き換えても'''構いません'''。同じ領域名で 複数の頭領域を受け取った場合、サーバーはメタ変数にする前に、 同じ意味を持つ単一頭領域を受け取ったものとして書き換え'''なければなりません'''。 同様に、複数行で受け取った頭領域は単一行にくっつけなければ '''なりません'''。サーバーは、必要があれば、データの表現 (例えば文字集合) を CGI メタ変数に適切な形に変えなければ '''なりません'''。 Servers are not required to create metavariables for all the request header fields that they receive. In particular, they MAY decline to make available any header fields carrying authentication information, such as "Authorization", or which are available to the script via other metavariables, such as "Content-Length" and "Content-Type". サーバーは受け取った頭領域全てについてメタ変数を作る必要はありません。 特に、「Authorization」(認証)のような認証情報を伝達する頭領域や、 他のメタ変数でスクリプトに伝えられる「Content-Length」(内容長) や「Content-Type」(内容型)のような頭領域を利用出来なくしても '''構いません'''。 *SEE ALSO -[[CGI]] --[[CGI/1.1]] --[[CGI/1.2]] --[[AUTH_TYPE]] --[[CONTENT_LENGTH]] --[[CONTENT_TYPE]] -[[HTTP]] --[[HTTP/1.0]] --[[HTTP/1.1]] -[[RFC822と仲間達の頭領域名]] --[[Authorization:領域]] --[[Content-Length:領域]] --[[Content-Type:領域]] -[[RFCのライセンス]] - [1] 方式 (scheme) が [[https:]] だったら ''HTTPS_[VAR[*]]'' になるんでしょうか。そんなの見たこと無いなあ。