/
441.txt
104 lines (80 loc) · 5.36 KB
/
441.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
* 仕様書
[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.7>'''
]REFS]
* 文脈
[212] [[鯖]]は、 [CODE(HTTP)@en[[[OPTIONS]]]] [[要求]]に対して成功の[[応答]]を帰す場合には、
[[鯖]]が実装していて[[対象資源]]に適用できるオプション機能を示す[[ヘッダー]]
(例えば [CODE(HTTP)@en[[[Allow:]]]]) を送信する[['''べきです''']]
[SRC[>>206]]。
* Allow vs Allowed
- [1] [HTTP92] では、 [CODE(HTTP)[Allow:]] という記述と [CODE(HTTP)[[[Allowed]]:]] という記述が混じっています。
- [2] 歴史的には [CODE(HTTP)[Allow:]] が正しいです。
* 状態符号
[406] [CODE(HTTP)@en[[[Allow:]]]] 欄は [CODE(HTTP)[[[405]]]] [[応答]]に存在しなければ[['''なりません''']]。
[407] [CODE(HTTP)[[[501]]]] でも [CODE(HTTP)@en[[[Allow:]]]] [[ヘッダー]]が使われることがあります。
* 仕様書から
** RFC 1945 (HTTP/1.0) 10.1; RFC 2068 (HTTP/1.1) 14.7 Allow
> The Allow entity-header field lists the set of methods supported by
the resource identified by the Request-URI. The purpose of this field
is strictly to inform the recipient of valid methods associated with
the resource. The Allow header field [DEL[[INS[{1945}]] is not permitted in a request as part of a POST entity]] [INS[[INS[{2068〜}]] MUST be present in a 405 (Method Not Allowed) response]].
[CODE(HTTP)[Allow]] 実体頭欄は、 [[Request-URI]]
で識別される資源が対応している [[method]]
の集合を列挙します。この欄の目的は、
その資源に関連付けられた妥当な method
を受信者に厳密に通知することです。
[CODE(HTTP)[Allow]] 頭欄は、 [DEL[[INS[{1945}]] 要求の [[POST]] 実体の一部としては認めません。]] [INS[[INS[{2068〜}]] [CODE(HTTP)[[[405]]]] (Method 不認可) 応答中に出現しなければ'''なりません'''。]]
>
- [DEL[[INS[{〜2068}]] Allow = "Allow" ":" 1#method]]
- [INS[[INS[{2616}]] Allow = "Allow" ":" #Method]]
>Example of use: [INS[使用例 : ]]
>
- Allow: GET, HEAD[INS[, PUT [INS[{2068}]]]]
>This field cannot prevent a client from trying other methods.
However, the indications given by the Allow header field value [DEL[[INS[{1945}]] should]] [INS[[INS[{2068}]] SHOULD]]
be followed. The actual set of allowed methods is defined by the
origin server at the time of each request.
この欄は、クライアントアが他の method
を試行することを防ぐことは出来ません。
しかし、 [CODE(HTTP)[Allow]] 頭欄値による標示には従う'''べきです'''。
認められる method の実際の集合は、各要求の時点[[起源サーバー]]により定義されます。
[INS[
> [INS[{2068〜}]] The Allow header field MAY be provided with a PUT request to
recommend the methods to be supported by the new or modified
resource. The server is not required to support these methods and
SHOULD include an Allow header in the response giving the actual
supported methods.
[CODE(HTTP)[Allow]] 頭欄は、新規のまたは修正済みの資源が対応している
method を推奨するために [CODE(HTTP)[[[PUT]]]]
要求で提供しても'''構いません'''。
サーバーはそれらの method に対応する必要はありませんし、
応答中の [CODE(HTTP)[Allow]] 頭には実際に対応している
method を含める'''べきです'''。
]INS]
>A proxy [DEL[[INS[{1945}]] must not]] [INS[[INS[{2068}]] MUST NOT]] modify the Allow header field even if it does not
understand all the methods specified, since the user agent [DEL[[INS[{1945}]] may]] [DEL[[INS[[INS[{2068}]] MAY]]]] [INS[[INS[{2616}]] might]] have
other means of communicating with the origin server.
[[串]]は、指定された全ての method
を理解しないとしても、 [CODE(HTTP)[Allow]]
頭欄を修正しては'''なりません'''。
[[利用者エージェント]]はもしかすると起源サーバーと通信する他の手段を持っているかもしれないからです。
[DEL[
> [INS[{〜2068}]] The Allow header field does not indicate what methods are implemented [DEL[[INS[{1945}]] by]] [INS[[INS[{2068}]] at]] the server [INS[[INS[{2068}]] level]]. [INS[[INS[{2068}]] Servers MAY use the Public response-header field (section 14.35) to describe what methods are implemented on the server as a whole.]]
[CODE(HTTP)[Allow]] 頭欄は、サーバー段階でどの method
が実装されているかは示しません。サーバーは、
サーバー全体としてどの method を実装しているかを記述するのに、
[CODE(HTTP)[[[Public]]]] 応答頭欄を使っても'''構いません'''。
]DEL]
** RFC の部分の License
[[RFCのライセンス]]
* 関連
[3] [CODE(HTTP)@en[[[Allow]]]] に [CODE(HTTP)@en[[[PATCH]]]] が含まれる場合、
[CODE(HTTP)@en[[[Accept-Patch]]]] [[頭欄]]も[[応答]]に含める[['''べきです''']]
[SRC[[[RFC 5789]]]]。
[502] [CITE@en[RFC 3507 - Internet Content Adaptation Protocol (ICAP)]]
( ([TIME[2014-06-08 07:17:07 +09:00]] 版))
<http://tools.ietf.org/html/rfc3507#page-14>
[503] [CITE@en[RFC 3507 - Internet Content Adaptation Protocol (ICAP)]]
( ([TIME[2014-06-08 07:17:07 +09:00]] 版))
<http://tools.ietf.org/html/rfc3507#section-4.6>