Parent Directory
|
Revision Log
updated by (anon)
1 | [53] データの[[バイト列]]を検査してその[[MIME型]]などを決定することを、[DFN[[[sniffing]]]] といいます。 |
2 | |
3 | [54] [DFN[[[MIME Sniffing]]]] 仕様書が [[Web]] における [[sniffing]] について規定しています。 |
4 | |
5 | * 仕様書 |
6 | |
7 | [REFS[ |
8 | - [32] [CITE[MIME Sniffing]] ([TIME[2011-11-27 08:05:14 +09:00]] 版) <http://mimesniff.spec.whatwg.org/> |
9 | ]REFS] |
10 | |
11 | * Sniffing が行われる場面 |
12 | |
13 | [61] [[sniffing]] は次の場面で行われます。 |
14 | |
15 | [FIG[ |
16 | - [[MIME type sniffing algorithm]] |
17 | -- [[navigate]] |
18 | -- [CODE(HTMLe)@en[[[object]]]] |
19 | - [[rules for distinguishing if a resource is text or binary]] |
20 | -- [CODE(HTMLe)@en[[[object]]]] |
21 | - [[rules for sniffing images specifically]] |
22 | -- [CODE(HTMLe)@en[[[link]]]] が[[画像]]を指す場合 |
23 | -- [CODE(HTMLe)@en[[[img]]]] |
24 | -- [CODE(HTMLe)@en[[[object]]]] |
25 | -- [CODE(HTML)@en[[[<input type=image>]]]] |
26 | -- [CODE(DOMm)@en[[[createImageBitmap]]]] で [CODE(DOMi)@en[[[Blob]]]] の場合 |
27 | ]FIG] |
28 | |
29 | [62] [[媒体要素]]と[[テキストトラック]]についても [[sniffing]] を行うかどうかは未決となっています。 |
30 | |
31 | [63] [[CSS]] の[[画像]]も [[sniffing]] を行っているはずですが現在それはどこにも規定されていません。 |
32 | |
33 | * その他の sniffing |
34 | |
35 | ** JSON Sniffing |
36 | |
37 | [25] [[RFC 4627]] が [[JSON]] の [[charset]] [[sniffing]] について言及しています。 |
38 | |
39 | ** RDFa 処理器の Sniffing |
40 | |
41 | [50] [[RDFa 1.1]] に基づく [[RDFa処理器]]は、 [[MIME型]]によって[[ホスト言語]]を決定しなければ[['''なりません''']]。 |
42 | [[MIME型]]を決定できないか未対応の時は、 [CODE(MIME)@en[[[application/xml]]]] としなければ[['''なりません''']]。 |
43 | [SRC[>>49]] |
44 | |
45 | [51] >>50 の直後にこれと矛盾する次のような「NOTE」があります。 [[MIME型]]が無い時、 |
46 | [[DOCTYPE]]、[[根要素]]、[[拡張子]]、[[利用者]]定義の引数など追加の仕組みを用いても[['''構いません''']] [SRC[>>49]]。 |
47 | |
48 | [REFS[ |
49 | - [49] [CITE@en[RDFa Core 1.1 - Second Edition]] ([TIME[2013-08-15 17:12:47 +09:00]] 版) <http://www.w3.org/TR/rdfa-core/#h3_processorconf> |
50 | ]REFS] |
51 | |
52 | * 歴史 |
53 | |
54 | [55] [[IE]] は古くから [CODE(HTTP)@en[[[Content-Type:]]]] ヘッダーを一部無視して[[拡張子]]を使ったり |
55 | [[sniffing]] したりしており、それによって他の [[Webブラウザー]]と異なる解釈をしたり、 |
56 | それによって (本来の仕様上は問題ないはずのもので) [[セキュリティー]]上の問題を引き起こしたりして非難されていました。 |
57 | しかし間違った [CODE(HTTP)@en[[[Content-Type:]]]] を送出する[[起源鯖]]も広く存在しており、 |
58 | また他のブラウザーも [CODE(HTMLe)@en[[[script]]]] の [CODE(HTTP)@en[[[Content-Type:]]]] |
59 | を無視したり、 [CODE(HTMLe)@en[[[img]]]] では [[sniffing]] を行ったりしていて、 |
60 | [[sniffing]] を排除することは最早できない状況でした。 |
61 | |
62 | [56] そうはいっても各 [[Webブラウザー]]が独自に異なる [[sniffing]] を行って標準仕様が存在しない状況では、 |
63 | サーバー側で[[セキュリティー]]上の問題を回避するための十分な対策を施すのも困難 (何をもって十分としてよいかすらわからない状態) |
64 | でありました。 |
65 | |
66 | [57] 2007年頃になってようやく [[Ian Hickson]] によって [[WHATWG]] [[Web Applications 1.0]] (後の [[HTML5]]、 |
67 | 現在の [[HTML Standard]]) で [[Webブラウザー]]が実装するべき [[sniffing]] の規則が正確かつ詳細に規定されるようになりました。 |
68 | |
69 | [58] その後 [[IETF]] と [[W3C]] の圧力によって [[sniffing]] は [[HTML5]] 仕様書から切り離され、 |
70 | この分野の専門家である [[Adam Barth]] による [[Internet Draft]] として [[IETF]] で出版されるようになりました。 |
71 | |
72 | [59] しかしその作業も停滞していたことから 2012年、 [[Gordon P. Hemsley]] が引き取って再び [[WHATWG]] |
73 | で [[Living Standard]] として出版されるようになりました。 |
74 | |
75 | ;; [60] 同じような経緯で [[W3C]] に行った仕様書はその後 [[WHATWG]] で作業が再開された後 [[W3C]] |
76 | が劣化コピーを発行し続ける例が多いですが、 [[IETF]] はそういうことはしていません。 |
77 | |
78 | * メモ |
79 | |
80 | [1] |
81 | [CITE[葉っぱ日記 - 「拡張子ではなく、内容によってファイルを開くこと」の拡張子は Content-Type ではないことに注意]] ([CODE[2007-04-04 15:46:35 +09:00]] 版) <http://d.hatena.ne.jp/hasegawayosuke/20070404/p1> |
82 | ([[名無しさん]] [WEAK[2007-04-04 23:46:23 +00:00]]) |
83 | |
84 | [2] |
85 | [CITE@en[Re: Proposed Design Principles updated]] ([[Ian Hickson]] 著, [CODE[2007-04-05 14:51:37 +09:00]] 版) <http://lists.w3.org/Archives/Public/public-html/2007Apr/0232.html> |
86 | |
87 | > One browser started ignoring CSS files in one very specific |
88 | case, namely only if the document had a DOCTYPE that, at the time, was |
89 | basically unused. (I was one of the two people pushing for this.) It broke |
90 | some sites, but comparatively few in the grand scheme of things. (Though |
91 | we still get bug reports about this today, so maybe it wasn't that good an |
92 | idea after all.) |
93 | |
94 | ([[名無しさん]]) |
95 | |
96 | |
97 | [3] |
98 | [CITE[Mime sniffing data]] ([[Adam Barth <whatwg@...>]] 著, [TIME[2008-10-09 01:34:49 +09:00]] 版) <http://permalink.gmane.org/gmane.org.w3c.whatwg.discuss/15882> |
99 | |
100 | [4] [CITE[Content-Type Processing Model ]] ([TIME[2009-01-10 07:14:52 +09:00]] 版) <http://webblaze.cs.berkeley.edu/2009/mime-sniff/mime-sniff.txt> |
101 | |
102 | [5] [CITE@en[Sam Ruby: Mime Sniff]] ([TIME[2009-01-12 10:24:59 +09:00]] 版) <http://intertwingly.net/blog/2009/01/09/Mime-Sniff> |
103 | |
104 | [6] [CITE[IRC logs: freenode / #whatwg / 20090927]] |
105 | ([TIME[2009-11-30 23:26:32 +09:00]] 版) |
106 | <http://krijnhoetmer.nl/irc-logs/whatwg/20090927#l-135> |
107 | |
108 | [7] [CITE[IRC logs: freenode / #whatwg / 20090927]] |
109 | ([TIME[2009-11-30 23:26:32 +09:00]] 版) |
110 | <http://krijnhoetmer.nl/irc-logs/whatwg/20090927#l-320> |
111 | |
112 | [8] [CITE[IRC logs: freenode / #whatwg / 20090929]] |
113 | ([TIME[2009-12-02 08:29:55 +09:00]] 版) |
114 | <http://krijnhoetmer.nl/irc-logs/whatwg/20090929#l-357> |
115 | |
116 | [9] [CITE[Bug 8479 – http content-type override mandatory for <object>]] |
117 | ([TIME[2010-01-10 22:59:48 +09:00]] 版) |
118 | <http://www.w3.org/Bugs/Public/show_bug.cgi?id=8479> |
119 | |
120 | [10] [CITE@en[HTML5 Revision Tracker]] |
121 | ([TIME[2010-04-14 21:50:48 +09:00]] 版) |
122 | <http://html5.org/tools/web-apps-tracker?from=5041&to=5042> |
123 | |
124 | [11] [CITE[''''''[''''''whatwg'''''']'''''' Video with MIME type application/octet-stream]] |
125 | ( ([TIME[2010-09-02 00:45:32 +09:00]] 版)) |
126 | <http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-August/028291.html> |
127 | |
128 | [12] [CITE[IRC logs: freenode / #whatwg / 20100825]] |
129 | ( ([TIME[2010-09-04 09:44:11 +09:00]] 版)) |
130 | <http://krijnhoetmer.nl/irc-logs/whatwg/20100825#l-1199> |
131 | |
132 | [13] [CITE@en[Speech Synthesis Markup Language (SSML) Version 1.1]] |
133 | ( ([TIME[2010-09-08 00:26:19 +09:00]] 版)) |
134 | <http://www.w3.org/TR/2010/REC-speech-synthesis11-20100907/#lexicon_type> |
135 | |
136 | [14] [CITE['''['''whatwg''']''' Video with MIME type application/octet-stream]] |
137 | ([TIME[2010-12-09 18:00:19 +09:00]] 版) |
138 | <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2010-December/029393.html> |
139 | |
140 | [15] [CITE@en[Web Applications 1.0 r5836 Bring the spec more in line with what the browsers do for video (largely, ignoring Content-Type). This will probably be tweaked further once Adam's draft has a section dedicated to sniffing media container formats.]] |
141 | ( ([TIME[2011-02-05 10:31:00 +09:00]] 版)) |
142 | <http://html5.org/tools/web-apps-tracker?from=5835&to=5836> |
143 | |
144 | [16] [CITE[''''''[''''''websec'''''']'''''' Font sniffing]] |
145 | ( ([TIME[2011-01-28 00:21:17 +09:00]] 版)) |
146 | <http://www.ietf.org/mail-archive/web/websec/current/msg00235.html> |
147 | |
148 | [17] [CITE@en[Web Applications 1.0 r5921 revert r5836 per http://lists.w3.org/Archives/Public/public-html/2011Mar/0002.html]] |
149 | ( ([TIME[2011-03-01 09:18:00 +09:00]] 版)) |
150 | <http://html5.org/tools/web-apps-tracker?from=5920&to=5921> |
151 | |
152 | [18] [CITE@en[Re: Request for revert on bug 11984]] |
153 | ( ([[Ian Hickson]] 著, [TIME[2011-03-01 09:14:52 +09:00]] 版)) |
154 | <http://lists.w3.org/Archives/Public/public-html/2011Mar/0002.html> |
155 | |
156 | [19] [CITE[IRC logs: freenode / #whatwg / 20110123]] |
157 | ( ([TIME[2011-03-05 11:46:54 +09:00]] 版)) |
158 | <http://krijnhoetmer.nl/irc-logs/whatwg/20110123> |
159 | |
160 | [20] [CITE[IRC logs: freenode / #whatwg / 20110124]] |
161 | ( ([TIME[2011-03-05 23:14:05 +09:00]] 版)) |
162 | <http://krijnhoetmer.nl/irc-logs/whatwg/20110124> |
163 | |
164 | [21] [CITE[IRC logs: freenode / #whatwg / 20110127]] |
165 | ( ([TIME[2011-03-10 07:30:55 +09:00]] 版)) |
166 | <http://krijnhoetmer.nl/irc-logs/whatwg/20110127> |
167 | |
168 | [22] [CITE[IRC logs: freenode / #whatwg / 20110205]] |
169 | ( ([TIME[2011-03-19 23:45:14 +09:00]] 版)) |
170 | <http://krijnhoetmer.nl/irc-logs/whatwg/20110205#l-71> |
171 | |
172 | [23] [CITE@en[Web Applications 1.0 r5979 10805]] |
173 | ( ([TIME[2011-04-09 07:12:00 +09:00]] 版)) |
174 | <http://html5.org/tools/web-apps-tracker?from=5978&to=5979> |
175 | |
176 | [24] [CITE[drafts/sniff.xml at master from abarth's ietf-websec - GitHub]] |
177 | ( ([TIME[2011-02-13 13:01:23 +09:00]] 版)) |
178 | <https://github.com/abarth/ietf-websec/blob/master/drafts/sniff.xml> |
179 | |
180 | [26] [CITE[MIME Sniffing]] |
181 | ( ([TIME[2011-09-27 05:18:56 +09:00]] 版)) |
182 | <http://mimesniff.spec.whatwg.org/> |
183 | |
184 | [27] [CITE@en[Web Applications 1.0 r6721 (WIP - MIMESNIFF has not yet been updated accordingly) Change the spec to use MIMESNIFF rules for text tracks instead of blindly honouring MIME types.]] |
185 | ( ([TIME[2011-10-21 08:27:00 +09:00]] 版)) |
186 | <http://html5.org/tools/web-apps-tracker?from=6720&to=6721> |
187 | |
188 | [28] [CITE@en[Web Applications 1.0 r6823 Make appcache no longer check for the MIME type.]] |
189 | ( ([TIME[2011-11-11 09:36:00 +09:00]] 版)) |
190 | <http://html5.org/tools/web-apps-tracker?from=6822&to=6823> |
191 | |
192 | [29] [CITE@en[Web Applications 1.0 r6826 Add warnings about media elements and track and how to determine the type and how we don't know what hte solution is.]] |
193 | ( ([TIME[2011-11-12 09:22:00 +09:00]] 版)) |
194 | <http://html5.org/tools/web-apps-tracker?from=6825&to=6826> |
195 | |
196 | [30] [CITE@en[Web Applications 1.0 r6920 Remove vestiges of MIME type checking in appcache.Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=14701]] |
197 | ( ([TIME[2012-01-26 08:27:00 +09:00]] 版)) |
198 | <http://html5.org/tools/web-apps-tracker?from=6919&to=6920> |
199 | |
200 | [31] [CITE@en[Web Applications 1.0 r6990 Factor out the prescan algorithm for reuse in other specs.]] |
201 | ( ([TIME[2012-02-14 06:06:00 +09:00]] 版)) |
202 | <http://html5.org/tools/web-apps-tracker?from=6989&to=6990> |
203 | |
204 | [33] [CITE[IRC logs: freenode / #whatwg / 20120801]] |
205 | ( ([TIME[2012-08-06 21:04:00 +09:00]] 版)) |
206 | <http://krijnhoetmer.nl/irc-logs/whatwg/20120801#l-248> |
207 | |
208 | [34] [CITE@en[Web Applications 1.0 r7360 Make a BOM override HTTP headers.]] |
209 | ( ([TIME[2012-09-16 12:55:00 +09:00]] 版)) |
210 | <http://html5.org/tools/web-apps-tracker?from=7359&to=7360> |
211 | |
212 | [35] [CITE[IRC logs: freenode / #whatwg / 20120928]] |
213 | ( ([TIME[2012-10-03 22:06:16 +09:00]] 版)) |
214 | <http://krijnhoetmer.nl/irc-logs/whatwg/20120928> |
215 | |
216 | [36] [CITE[IRC logs: freenode / #whatwg / 20120928]] |
217 | ( ([TIME[2012-10-03 22:06:16 +09:00]] 版)) |
218 | <http://krijnhoetmer.nl/irc-logs/whatwg/20120928> |
219 | |
220 | [37] [CITE[whatwg/mimesniff]] |
221 | ( ([TIME[2012-10-03 22:39:05 +09:00]] 版)) |
222 | <https://github.com/whatwg/mimesniff> |
223 | |
224 | [38] [CITE[''''''[''''''whatwg'''''']'''''' '''['''mimesniff''']''' Review requested on MIME Sniffing Standard]] |
225 | ( ([TIME[2012-11-06 00:29:10 +09:00]] 版)) |
226 | <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-November/037787.html> |
227 | |
228 | [REFS[ |
229 | - [39] [CITE[Hosting - Google Chrome]] ([TIME[2012-11-18 01:28:56 +09:00]] 版) <http://developer.chrome.com/extensions/hosting.html> |
230 | ]REFS] |
231 | |
232 | [40] >>39 によると [[Chrome]] は未知の[[MIME型]]の sniffing で [CODE(MIME)@en[[[application/x-chrome-extension]]]] |
233 | にも対応しているようです。 |
234 | |
235 | [41] [CITE[Issue 7448 - chromium - CSS and JS files with MIME Type text/plain should still apply - An open-source browser project to help move the web forward. - Google Project Hosting]] |
236 | ( ([TIME[2012-11-18 01:42:41 +09:00]] 版)) |
237 | <http://code.google.com/p/chromium/issues/detail?id=7448> |
238 | |
239 | [42] [CITE[IRC logs: freenode / #whatwg / 20121018]] |
240 | ( ([TIME[2012-11-18 00:24:44 +09:00]] 版)) |
241 | <http://krijnhoetmer.nl/irc-logs/whatwg/20121018#l-259> |
242 | |
243 | [43] [CITE[IRC logs: freenode / #whatwg / 20121105]] |
244 | ( ([TIME[2012-11-24 13:19:40 +09:00]] 版)) |
245 | <http://krijnhoetmer.nl/irc-logs/whatwg/20121105#l-755> |
246 | |
247 | [44] [CITE[IRC logs: freenode / #whatwg / 20121109]] |
248 | ( ([TIME[2012-11-26 22:30:44 +09:00]] 版)) |
249 | <http://krijnhoetmer.nl/irc-logs/whatwg/20121109> |
250 | |
251 | [45] [CITE[Packaged Web Apps (Widgets) - Packaging and XML Configuration (Second Edition)]] |
252 | ( ([TIME[2012-11-22 21:22:20 +09:00]] 版)) |
253 | <http://w3c.github.com/packed-webapps/packaging/#rule-for-identifying-the-media-type-of-a-file> |
254 | |
255 | [46] [CITE@en[Web Applications 1.0 r7701 Revert part of r5545 because bz changed his mind and this matches reality better. :-)]] |
256 | ( ([TIME[2013-02-07 08:10:00 +09:00]] 版)) |
257 | <http://html5.org/tools/web-apps-tracker?from=7700&to=7701> |
258 | |
259 | [47] [CITE@en[Web Applications 1.0 r7701 Revert part of r5545 because bz changed his mind and this matches reality better. :-)]] |
260 | ( ([TIME[2013-02-07 08:10:00 +09:00]] 版)) |
261 | <http://html5.org/tools/web-apps-tracker?from=7700&to=7701> |
262 | |
263 | [48] [CITE@EN[Authoritative Metadata]] |
264 | ( ([TIME[2013-04-05 19:44:14 +09:00]] 版)) |
265 | <http://www.w3.org/2001/tag/doc/mime-respect-20130405.html> |
266 | |
267 | [52] [CITE@en[Windows RSS Publisher's Guide (work-in-progress) - Microsoft RSS Blog - Site Home - MSDN Blogs]] |
268 | ( ([TIME[2013-12-04 04:55:23 +09:00]] 版)) |
269 | <http://blogs.msdn.com/b/rssteam/archive/2005/08/02/publishersguide.aspx> |
270 | |
271 | [64] [CITE@en[Bug 11984 – <video>: Figure out the story with respect to honouring Content-Type headers vs sniffing content]] |
272 | ( ([TIME[2013-12-14 11:48:15 +09:00]] 版)) |
273 | <https://www.w3.org/Bugs/Public/show_bug.cgi?id=11984> |
274 | |
275 | [65] [CITE[IRC logs: freenode / #whatwg / 20131211]] |
276 | ( ([TIME[2013-12-13 22:33:10 +09:00]] 版)) |
277 | <http://krijnhoetmer.nl/irc-logs/whatwg/20131211#l-870> |
278 | |
279 | [66] [CITE[IRC logs: freenode / #whatwg / 20140121]] |
280 | ( ([TIME[2014-01-23 20:23:43 +09:00]] 版)) |
281 | <http://krijnhoetmer.nl/irc-logs/whatwg/20140121> |
282 | |
283 | [67] [CITE[ncsa-mosaic/CHANGES at master · alandipert/ncsa-mosaic]] |
284 | ( ([TIME[2014-04-07 05:28:45 +09:00]] 版)) |
285 | <https://github.com/alandipert/ncsa-mosaic/blob/master/CHANGES#L179> |
286 | |
287 | [68] [CITE[ncsa-mosaic/CHANGES at master · alandipert/ncsa-mosaic]] |
288 | ( ([TIME[2014-04-07 05:38:10 +09:00]] 版)) |
289 | <https://github.com/alandipert/ncsa-mosaic/blob/master/CHANGES#L885> |
admin@suikawiki.org | ViewVC Help |
Powered by ViewVC 1.1.24 |