/
397.txt
86 lines (71 loc) · 5.29 KB
/
397.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
* 仕様書
[REFS[
- [416] [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-5.3.2>
- [411] [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-5.3.3>
]REFS]
* 文脈
[436] [[起源鯖]]は、 [CODE(HTTP)@en[[[Accept:]]]] [[ヘッダー]]に利用できる[[表現]]の
[[MIME型]]がない場合は、 [CODE(HTTP)[[[406]]]] を送信することもできますし、
[[内容折衝]]の対象でない場合のように無視して処理しても構いません [SRC[>>416]]。
[421] [[起源鯖]]は、 [CODE(HTTP)@en[[[Accept-Charset:]]]] に利用可能な[[表現]]の
[[charset]] がなければ、 [CODE(HTTP)@en[[[406]]]] を返すこともできますし、
無視して[[内容折衝]]の対象でないものとして処理することもできます [SRC[>>411]]。
;; [437] [CODE(HTTP)@en[[[Accept-Encoding:]]]] については [CODE(HTTP)[[[406]]]]
を返すことは[[起源鯖]]の動作の候補として明記されていません。
* From specifications
** RFC 2068 & 2616 (HTTP/1.1) 10.4.7 406 Not Acceptable
> The resource identified by the request is only capable of generating
response entities which have content characteristics not acceptable
according to the accept headers sent in the request.
要求で識別される資源は、要求で送られた受入れ頭群に従うと受入れ可能でない内容特徴を持った応答実体を生成する能力しかありません。
> Unless it was a HEAD request, the response SHOULD include an entity
containing a list of available entity characteristics and location(s)
from which the user or user agent can choose the one most
appropriate. The entity format is specified by the media type given
in the Content-Type header field. Depending upon the format and the
capabilities of the user agent, selection of the most appropriate
choice [DEL[may]] [INS[MAY]] be performed automatically. However, this specification
does not define any standard for such automatic selection.
[CODE(HTTP)[[[HEAD]]]] 要求である場合を除き、応答は、
利用可能な実体特徴と位置の一覧を含めて、
利用者又は利用者エージェントが最も適当なものを選ぶことができるようにする'''べきです'''。
実体の書式は [CODE(HTTP)[[[Content-Type]]]] 頭欄に示された[[媒体型]]により規定されます。
その書式と利用者エージェントの能力によっては、
最も適切な選択肢の選択は自動的に行っても'''構いません'''。
しかし、この仕様書はその自動的選択の規格は定義しません。
> Note: HTTP/1.1 servers are allowed to return responses which are
not acceptable according to the accept headers sent in the request.
In some cases, this may even be preferable to sending a 406
response. User agents are encouraged to inspect the headers of an
incoming response to determine if it is acceptable. If the response
could be unacceptable, a user agent SHOULD temporarily stop receipt
of more data and query the user for a decision on further actions.
注意 : HTTP/1.1 サーバーは、要求で送られた受入れ頭群に従うと受け入れ可能でない応答を返すことが認められています。
場合によっては、 [CODE(HTTP)[406]] 応答を送るよりこの方が好ましいかもしれません。
利用者エージェントは、やってくる応答が受入れ可能であるか、その頭を調べることをお勧めします。
応答が受入れ不能であったなら、利用者エージェントはそれ以上のデータの受入れを一時的に停止し、
利用者に以後の動作の決定を求める'''べきです'''。
** RFC 2324 (HTCPCP/1.0) 2.3.1 406 Not Acceptable
>This return code is normally interpreted as "The resource identified
by the request is only capable of generating response entities which
have content characteristics not acceptable according to the accept
headers sent in the request. In HTCPCP, this response code MAY be
returned if the operator of the coffee pot cannot comply with the
Accept-Addition request. Unless the request was a HEAD request, the
response SHOULD include an entity containing a list of available
coffee additions.
> In practice, most automated coffee pots cannot currently provide
additions.
この返し符号は、通常
「その要求により識別される資源は、
その要求中で送られた受入れ (accept)
に従って受入れ可能でない内容性質を持つ応答実体を生成する能力しかない。」と解釈されます。
[[HTCPCP]] では、珈琲ポットの操作者が
[CODE(HTTP)[[[Accept-Addition]]]]
要求を満たすことが出来ない時にこの応答符号を返しても'''構いません'''。
要求が [CODE(HTTP)[[[HEAD]]]]
要求である場合を除いて、応答は受入れ可能な珈琲添加物の一覧を含んだ実体を含める'''べきです'''。
実際には、ほとんどの自動化珈琲ポットは現在の所添加物を提供できません。
** RFC の部分の License
[[RFCのライセンス]]参照。
* メモ