blob: d3371d93fe98774b5245a14158cd340c3896a084 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="/js-test-resources/js-test.js"></script>
<script>
description("Tests that a redirected cross-origin fetch load fails if the server blocks it with a 'From-Origin: same' response header, even though the server includes an Access-Control-Allow-Origin response header.");
jsTestIsAsync = true;
fetch("http://127.0.0.1:8000/from-origin/resources/redirect.php?redirectTo=http://localhost:8000/from-origin/resources/fetch.php?fromOrigin=same").then(function(response) {
return response.json();
}).then(function(data) {
const parsedData = JSON.parse(data);
if (parsedData.Fetch)
testFailed("Fetch succeeded.");
else
testFailed("Unknown fetch response.");
finishJSTest();
}).catch(function(error) {
testPassed("Fetch blocked. " + error);
finishJSTest();
});
</script>
</head>
<body>
</body>
</html>