/
105.txt
130 lines (92 loc) · 6.31 KB
/
105.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
[430] [DFN[[CODE(HTTP)@en[[[Content-Encoding:]]]]]] [[ヘッダー]]は、
[[表現]]に適用されている[[内容符号化]]を表します。
* 仕様書
[REFS[
- [429] '''[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-3.1.2.2>'''
- [3] [CITE@ja[コンテントネゴシエーション - Apache HTTP サーバ バージョン 2.4]] ([TIME[2014-05-22 04:08:21 +09:00]] 版) <http://httpd.apache.org/docs/current/content-negotiation.html#extensions>
- [6] [CITE@en[RFC 6968 - FCAST: Object Delivery for the Asynchronous Layered Coding (ALC) and NACK-Oriented Reliable Multicast (NORM) Protocols]] ([TIME[2014-09-14 18:07:31 +09:00]] 版) <https://tools.ietf.org/html/rfc6968#page-10>
- [8] [CITE@en[RFC 6968 - FCAST: Object Delivery for the Asynchronous Layered Coding (ALC) and NACK-Oriented Reliable Multicast (NORM) Protocols]] ([TIME[2014-09-14 18:07:31 +09:00]] 版) <https://tools.ietf.org/html/rfc6968#section-3.3>
- [9] [CITE@en[RFC 6968 - FCAST: Object Delivery for the Asynchronous Layered Coding (ALC) and NACK-Oriented Reliable Multicast (NORM) Protocols]] ([TIME[2014-09-14 18:07:31 +09:00]] 版) <https://tools.ietf.org/html/rfc6968#page-21>
]REFS]
* 意味
[431] [CODE(HTTP)@en[[[Content-Encoding:]]]] [[ヘッダー]]は、
[[MIME型]]に含まれているもの以外で[[表現]]に対して適用されている[[内容符号化]]を示します
[SRC[>>429]]。
[EG[
[432] 例えば [[XML]] ファイルを [[gzip]] [[圧縮]]して転送する場合、
[CODE(HTTP)@en[[[Content-Type:]]]] は [CODE(MIME)@en[[[application/xml]]]] となり、
[CODE(HTTP)@en[[[Content-Encoding:]]]] が [CODE(HTTP)@en[[[gzip]]]] となります。
]EG]
[439] [[表現]]が実際に[[メッセージ]]に含まれる場合はその[[内容符号化]]を表しますが、
[CODE(HTTP)@en[[[HEAD]]]] の場合は、 [CODE(HTTP)@en[[[GET]]]] だったなら含まれるであろう[[表現]]の[[内容符号化]]を表します。
* 構文
[433] 値は、1つ以上の[[内容符号化]]の値の[[リスト]] ([CODE[#]]) です [SRC[>>429]]。
[FIG(railroad)[
= [[字句]]
= *
== [[OWS]]
== [CODE[[[,]]]]
== [[OWS]]
== [[字句]]
]FIG]
[435] [[表現]]に対して複数の[[内容符号化]]が適用されているときは、
[[符号化]]を行う[[送信者]]は、適用順に並べた値を [CODE(HTTP)@en[[[Content-Encoding:]]]]
[[ヘッダー]]に含めなければ[['''なりません''']] [SRC[>>429]]。
[436] [[符号化]]についての追加の引数は、他の[[ヘッダー]]によって指定できます [SRC[>>429]]。
;; [437] 現時点でそのような例はありません。[[転送符号化]]については[[引数]]を指定する構文がありますが、
[[内容符号化]]には指定できません。
* 文脈
[434] この[[ヘッダー]]は、複数指定できます。
[7] [[FCAST]] でも使うことができます [SRC[>>6, >>8]]。
* 処理
[438] [[内容符号化]]の項を参照してください。
[10] [[FCAST]] の実装は、 [CODE(HTTP)@en[[[Content-Encoding:]] [[gzip]]]]
に対応しなければ[['''なりません''']] [SRC[>>9]]。
* [CODE(HTTP)@en[encoding]] 異体属性
[4] [[異体説明]]の [DFN[[CODE(HTTP)@en[[[encoding]]]]]] [[異体属性]]は、
[CODE(HTTP)@en[[[Content-Encoding:]]]] [[ヘッダー]]に相当するものです [SRC[>>3]]。
;; [5] この[[異体属性]]は [[RFC]] に含まれていない [[Apache]] の拡張です。
* 歴史
[2] [[HTTP92]] 時点では [CODE(HTTP)@en[[[x-compress]]]] と
[CODE(HTTP)@en[[[x-gzip]]]] が使われていました [SRC[>>1]]。
[REFS[
- [1] [CITE[Object Header lines in HTTP]] ([TIME[2002-04-11 00:31:17 +09:00]] 版) <http://www.w3.org/Protocols/HTTP/Object_Headers.html#content-encoding>
]REFS]
* メモ
[427] [CITE@en[RFC 4463 - A Media Resource Control Protocol (MRCP) Developed by Cisco, Nuance, and Speechworks]]
( ([TIME[2011-12-04 10:31:11 +09:00]] 版))
<http://tools.ietf.org/html/rfc4463#section-5.4.7>
[428] [CITE@en[RFC 6787 - Media Resource Control Protocol Version 2 (MRCPv2)]]
( ([TIME[2012-11-13 15:18:40 +09:00]] 版))
<http://tools.ietf.org/html/rfc6787#section-6.2.9>
[423] [CODE(HTTP)@en[[[Content-Encoding]]: [[identity]]]] を送ってくる[[鯖]]があります。
これを[[鯖]]が意図したように扱えない[[クライアント]]があります。
[440] [CITE[Fix request and response's body story · 578768a · whatwg/fetch]]
( ([TIME[2014-06-27 02:05:59 +09:00]] 版))
<https://github.com/whatwg/fetch/commit/578768a0c40b673ed9ce3e23020115af15d6ac49>
[441] [CITE[Reference Gecko bug for Content-Encoding quirk per https://github.com/sl... · cf2b3ba · whatwg/fetch]]
( ([TIME[2014-06-28 04:50:20 +09:00]] 版))
<https://github.com/whatwg/fetch/commit/cf2b3ba4968d2afb5c1d548f0803d98845a1d808>
[442] [CITE@en[1030660 – Is ClearBogusContentEncodingIfNeeded() needed?]]
( ([TIME[2014-06-28 04:52:04 +09:00]] 版))
<https://bugzilla.mozilla.org/show_bug.cgi?id=1030660>
[443] [CITE@en[35956 – File extension not changed but gzipped files expanded when saving]]
( ([TIME[2014-06-28 04:53:50 +09:00]] 版))
<https://bugzilla.mozilla.org/show_bug.cgi?id=35956>
[11] [CITE@en[52282 – (ftp:// or file://) suffixes like (.gz) are Content-Encoding (not Content-Type) ''''''[''''''decode and display .gz file'''''']'''''']]
([TIME[2015-08-04 23:50:28 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=52282>
[12] [CITE@en[draft-ietf-httpbis-cice-03 - Hypertext Transfer Protocol (HTTP) Client-Initiated Content-Encoding]]
([TIME[2015-11-04 15:26:39 +09:00]] 版)
<https://tools.ietf.org/html/draft-ietf-httpbis-cice-03>
[13] [CITE@en[Add PushManager.supportedContentEncodings (#252)]]
([[beverloo]]著, [TIME[2017-04-26 01:13:27 +09:00]])
<https://github.com/w3c/push-api/commit/813f9af75d59e3fa1522db9aeeaa2bd158ff10bf>
[FIG(quote)[
[FIGCAPTION[
[14] [CITE@en[Service » HTTP interface · validator/validator Wiki]]
([TIME[2017-05-30 00:02:36 +09:00]])
<https://github.com/validator/validator/wiki/Service-%C2%BB-HTTP-interface#request-compression>
]FIGCAPTION]
> The checker supports HTTP request compression. To use it, compress the request entity body using gzip and specify Content-Encoding: gzip as a request header.
]FIG]