Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="connect-src 'self' http://{{host}}:{{ports[http][0]}}; script-src 'self' 'unsafe-inline';">
<title>connect-src-fetch-keepalive-allowed</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src='../support/logTest.sub.js?logs=["Pass"]'></script>
<script src="../support/alertAssert.sub.js?alerts=[]"></script>
<!-- enforcing policy:
connect-src 'self' http://{{host}}:{{ports[http][0]}}; script-src 'self' 'unsafe-inline';
-->
</head>
<body>
<script>
window.addEventListener('securitypolicyviolation', function(e) {
log("FAIL");
});
promise_test(async function(t) {
try {
keepalive: true
});
log("Pass");
} catch (e) {
log("Fail");
}
}, "fetch with keepalive should be allowed by CSP");
</script>
<div id="log"></div>
</body>
</html>