Skip to content

Commit

Permalink
Images are always sniffed
Browse files Browse the repository at this point in the history
See whatwg/fetch#395 for details.
  • Loading branch information
annevk committed Dec 16, 2016
1 parent d6f0cdc commit 8edebdc
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions fetch/nosniff/image.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,8 @@
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<script>
var fails = ["", "?type=", "?type=x", "?type=x/x"],
passes = ["?type=image/gif", "?type=image/png", "?type=image/png;blah"]

fails.forEach(function(urlpart) {
async_test(function(t) {
var img = document.createElement("img")
img.onerror = t.step_func_done(function(){})
img.onload = t.unreached_func("Unexpected load event")
img.src = "resources/image.py" + urlpart
document.body.appendChild(img)
}, "URL query: " + urlpart)
})
// Note: images get always sniffed, nosniff doesn't do anything
var passes = ["", "?type=", "?type=x", "?type=x/x", "?type=image/gif", "?type=image/png", "?type=image/png;blah"]

passes.forEach(function(urlpart) {
async_test(function(t) {
Expand Down

0 comments on commit 8edebdc

Please sign in to comment.