blob: 62ad8f25aa6a5abd448a0affee1b1744fbc2b835 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="/js-test-resources/js-test.js"></script>
<script>
description("Tests that we do not crash when XHR reuses a cached resource that contains a simple cross origin redirect.");
jsTestIsAsync = true;
const url = "/cache/resources/cache-control-redirect?code=302&cache_control=public,max-age=1000&url=http%3A%2F%2Flocalhost%3A8000%2Fsecurity%2Fresources%2Fallow-if-origin.php%3FallowCache%26allowCredentials%26origin%3Dhttp%253A%252F%252F127.0.0.1%253A8000";
xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.onload = function() {
xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.onload = function() {
shouldBeEqualToString("internals.xhrResponseSource(xhr)", "Memory cache");
finishJSTest();
};
xhr.open("GET", url);
xhr.send();
};
xhr.open("GET", url);
xhr.send();
</script>
</body>
</html>