#?SuikaWiki/0.9 *CGI/1.1 (coar draft 03) **7.2.1.3. Status The "Status" header field is used to indicate to the server what status code the server MUST use in the response message. "Status" 頭欄はサーバーがどの状態符号を応答メッセージに使わ'''なければならない''' かをサーバーに示すのに使います。 Status = "Status" ":" digit digit digit SP reason-phrase NL reason-phrase = * The valid status codes are listed in section 6.1.1 of the HTTP/1.0 specifications [3]. If the SERVER_PROTOCOL is "HTTP/1.1", then the status codes defined in the HTTP/1.1 specification [8] may be used. If the script does not return a "Status" header field, then "200 OK" SHOULD be assumed by the server. 妥当な状態符号は HTTP/1.0 仕様書の 6.1.1節に列挙されています。 [[SERVER_PROTOCOL]] が "HTTP/1.1" の場合、状態符号は HTTP/1.1 で定義されているものを使って構いません。 Script が "Status" 頭欄を返さない場合は、 "200 OK" がサーバーにより 仮定される'''べきです'''。 If a script is being used to handle a particular error or condition encountered by the server, such as a '404 Not Found' error, the script SHOULD use the "Status" CGI header field to propagate the error condition back to the client. E.g., in the example mentioned it SHOULD include a "Status: 404 Not Found" in the header data returned to the server. Script がサーバーの遭遇した特定の誤り又は状態, 例えば「404 Not Found」誤りを取り扱うのに使われる場合、 script は顧客に誤り状態を伝えるために "Status" CGI 頭欄を使う'''べきです'''。 例えばこの例では、サーバーに返される頭データに "Status: 404 Not Found" を含める'''べきです'''。 **BNF =Status = "Status:" [WSP] Status-Code SP Reason-Phrase =Status-Code = 3DIGIT =Reason-Phrase = cgi-rtext / http-rtext =cgi-rtext = %x20-7E =http-rtext = %x09 / %x20-7E / %x80-FF [[HTTP応答]]の staus-line では Reason-Phrase は OCTET - CTL + LWS - CR - LF で定義されているのですが、 CGI/1.1 では CHAR - CTL ですから、 CGI の方が使える文字が少ないことになります。 参考までに、 =sip-rtext = %x09 / %x20-7E / UTF8-xtra です。が、 [[SIP-CGI]] に Status: 欄はありません。 [[#comment]] *DSN の受信者毎欄群 [9] [[DSN]] の受信者毎にその状態を書き入れる欄で、 (受信者毎に) 必須です。 [[RFC1894]] で定義されています。 -[10] status-field = "Status" ":" status-code -[11] status-code = DIGIT "." 1*3DIGIT "." 1*3DIGIT [12] [[空白間隔]]文字・注釈は [CODE(ABNF)[status-code]] 中に挿入できません。 しかし、注釈 ([[comment]]) は [CODE(ABNF)[status-code]] の後に入れられます。 と書いてあるのですが、それでは [SAMP["Status: (comment) 1.2.3"]] はありですか? [13] 1*3DIGIT では、頭に 0 がきてはいけません。 [14] >>10-13 を元に [[ABNF]] で書き直してみると、 -[15] DSN.Status = "Status:" FWS status-code [CFWS] / obs-DSN.Status -[16] status-code = DIGIT "." sdigit "." sdigit -[17] sdigit = ("1" / "2" /.../ "9") 1*2DIGIT -[23] obs-DSN.Status = "Status" [FWS] ":" [CFWS] status-code [CFWS] [18] [CODE(ABNF)[status-code]] には、配送状況を表す符号値が入ります。最初の数字は [CODE[2]] (成功), [CODE[4]] (継続的で一時的な失敗), [CODE[5]] (恒久的失敗) です。 [19] 2番目の数字は推定原因で、3番目の数字は失敗状況です。 [20] 実際の値は、 [[RFC1843]] 『Enhanced Mail System Status Codes』 (拡張メイル系状態符号) で定義されています。 - [24] >>20 [[RFC1893]] [[#comment]] **例 -[21] Status: 4.0.0 -[22] Status: 5.0.0 (permanent failure) [[#comment]] *RFC の部分の License [[RFCのライセンス]] *メモ