-
Notifications
You must be signed in to change notification settings - Fork 4
/
616.txt
111 lines (83 loc) · 5.88 KB
/
616.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
[214] [DFN[[CODE(HTTP)@en[[[TRACE]]]]]] [[メソッド]]は、[[要求メッセージ]]を[[応答]]に含めて送り返すことを[[要求]]するものです。
[213] [CODE(HTTP)@en[[[TRACE]]]] は、試験や診断のために有用であるとされています [SRC[>>206]]。
特に [CODE(HTTP)@en[[[Via:]]]] が見られるのは有用と考えられています [SRC[>>206]]。
* 仕様書
[REFS[
- [206] '''[CITE@en[RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content]] ([TIME[2014-06-07 01:55:45 +09:00]] 版) <https://tools.ietf.org/html/rfc7231#section-4.3.8>'''
- [202] [CITE@en[RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content]] ([TIME[2014-06-07 01:55:45 +09:00]] 版) <https://tools.ietf.org/html/rfc7231#section-4.2.1>
- [205] [CITE@en[RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content]] ([TIME[2014-06-07 01:55:45 +09:00]] 版) <https://tools.ietf.org/html/rfc7231#section-4.2.2>
]REFS]
* 意味
[207] [CODE(HTTP)@en[[[TRACE]]]] は、遠隔の応用レベルでの[[要求メッセージ]]の[[ループバック]]を[[要求]]するものです
[SRC[>>206]]。
* 構文
[210] [[クライアント]]は、 [CODE(HTTP)@en[[[TRACE]]]] [[要求]]に[RUBYB[繊細]@en[sensitive]]なデータを含む[[ヘッダー]]を含めて[[生成]]しては[['''なりません''']]
[SRC[>>206]]。
[215] [[クライアント]]は、[[メッセージ本体]]を送信しては[['''なりません''']] [SRC[>>206]]。
* 性質
[203] [CODE(HTTP)@en[[[TRACE]]]] は、[[安全なメソッド]] [SRC[>>202]] で、
[[冪等なメソッド]] [SRC[>>205]] です。
[216] [CODE(HTTP)@en[[[TRACE]]]] [[要求]]に対する[[応答]]は、
[[キャッシュ可能]]ではありません [SRC[>>206]]。
* 処理モデル
[209] [[起源鯖]]か、 [CODE(HTTP)@en[[[Max-Forwards:]]]] [[ヘッダー]]の値が [[0]]
で受信した最初の[[鯖]]が、最終的な[[受信者]]です [SRC[>>206]]。
[208] [CODE(HTTP)@en[[[TRACE]]]] の最終的な[[受信者]]は、
受信した[[メッセージ]]を、一部の[[ヘッダー]]を除き、
[CODE(HTTP)@en[[[Content-Type:]]]] が [CODE(MIME)@en[[[message/http]]]]
である [CODE(HTTP)@en[[[200]]]] [[応答]]の[[メッセージ本体]]に含めて送信する[['''べきです''']]
[SRC[>>206]]。
* 除外するべきヘッダー
[211] [[クライアント]]も最終[[受信者]]も、[[要求]]において繊細なデータを含む[[ヘッダー]]は除外する[['''べき''']] [SRC[>>206]]
としています。
[212] [[credentials]] を含むものや[[クッキー]]を含むものがこれに含まれます [SRC[>>206]]。
ただし具体的な一覧は仕様書には示されていません。
* 歴史
[FIG(quote)[
[FIGCAPTION[
[204] RFC 2068・2616 (HTTP/1.1) 9.8 TRACE
]FIGCAPTION]
> The TRACE method is used to invoke a remote, application-layer loop-back of the request message. The final recipient of the request
SHOULD reflect the message received back to the client as the
entity-body of a 200 (OK) response. The final recipient is either the
origin server or the first proxy or gateway to receive a Max-Forwards
value of zero (0) in the request (see section 14.31). A TRACE request
MUST NOT include an entity.
[CODE(HTTP)[TRACE]] 方式は、要求メッセージの遠隔の[[応用層]] [[loop‐back]]
を呼出すのに使います。要求の最終受信者は、受信したメッセージをクライアントに
[CODE(HTTP)[[[200]]]] (了解) 応答の [CODE(ABNF)[[[entity-body]]]]
として反映させる'''べきです'''。
最終受信者は、[[起源サーバー]]か、または要求で
[CODE(HTTP)[[[Max-Forwards]]]] 値零 ([CODE(HTTP)[0]])
を受信した最初の[[串]]または[[関門]]です。
[CODE(HTTP)[TRACE]] 要求は[[実体]]を含んでは'''なりません'''。
> TRACE allows the client to see what is being received at the other
end of the request chain and use that data for testing or diagnostic
information. The value of the Via header field (section [DEL[14.44]] [INS[14.45]]) is of
particular interest, since it acts as a trace of the request chain.
Use of the Max-Forwards header field allows the client to limit the
length of the request chain, which is useful for testing a chain of
proxies forwarding messages in an infinite loop.
[CODE(HTTP)[TRACE]] は、クライアントが、[[要求鎖]]の反対側で何を受信したかを見て、
そのデータを検査や診断情報として使うことを可能とします。
[CODE(HTTP)[[[Via]]]] 頭欄の値は、要求鎖の追跡として働きますから、
特に興味深いです。 [CODE(HTTP)[[[Max-Forwards]]]]
頭欄を使用することでクライアントは要求鎖の長さを制限できますが、
これは無限循環するメッセージ転送串鎖を検査するのに有用です。
> If [DEL[successful]] [INS[the request is valid]], the response SHOULD contain the entire request message
in the entity-body, with a Content-Type of "message/http". Responses
to this method MUST NOT be cached.
要求が[[妥当]]であれば、応答は要求メッセージ全体を
[CODE(ABNF)[[[entity-body]]]] に含め、 [CODE(HTTP)[[[Content-Type]]]]
を [CODE(MIME)[[[message/http]]]] とする'''べきです'''。
この方式への応答は[[キャッシュ]]しては'''なりません'''。
]FIG]
* メモ
[REFS[
- [201] [CITE@ja-JP[高木浩光@自宅の日記 - 暗黙的に形成する事実標準の話と回避策の話を混同してはいけない, 駄目な技術文書の見分け方 その1の2]]
( ([[高木浩光]] 著, [TIME[2010-05-30 18:09:39 +09:00]] 版))
<http://takagi-hiromitsu.jp/diary/20061115.html>
]REFS]
[217] [CITE@en[297078 – setRequestHeader can be exploited using newline characters]]
( ([TIME[2014-07-02 14:52:09 +09:00]] 版))
<https://bugzilla.mozilla.org/show_bug.cgi?id=297078>