Skip to content

Commit 8edebdc

Browse files
committed
Images are always sniffed
See whatwg/fetch#395 for details.
1 parent d6f0cdc commit 8edebdc

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

fetch/nosniff/image.html

+2-12
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,8 @@
22
<script src=/resources/testharnessreport.js></script>
33
<div id=log></div>
44
<script>
5-
var fails = ["", "?type=", "?type=x", "?type=x/x"],
6-
passes = ["?type=image/gif", "?type=image/png", "?type=image/png;blah"]
7-
8-
fails.forEach(function(urlpart) {
9-
async_test(function(t) {
10-
var img = document.createElement("img")
11-
img.onerror = t.step_func_done(function(){})
12-
img.onload = t.unreached_func("Unexpected load event")
13-
img.src = "resources/image.py" + urlpart
14-
document.body.appendChild(img)
15-
}, "URL query: " + urlpart)
16-
})
5+
// Note: images get always sniffed, nosniff doesn't do anything
6+
var passes = ["", "?type=", "?type=x", "?type=x/x", "?type=image/gif", "?type=image/png", "?type=image/png;blah"]
177

188
passes.forEach(function(urlpart) {
199
async_test(function(t) {

0 commit comments

Comments
 (0)