applied-to-target.sub.html (1135B)
1 <!DOCTYPE html> 2 <html> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="../resources/test-helper.js"></script> 6 <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';"> 7 <script type="importmap"> 8 { 9 "imports": { 10 "../resources/log.js?pipe=sub&name=A": "https://{{domains[www1]}}:{{ports[https][0]}}/import-maps/resources/log.js?pipe=sub&name=B", 11 "https://{{domains[www1]}}:{{ports[https][0]}}/import-maps/resources/log.js?pipe=sub&name=C": "../resources/log.js?pipe=sub&name=D" 12 } 13 } 14 </script> 15 <script type="module"> 16 import '../resources/log.js?pipe=sub&name=A'; 17 </script> 18 <script type="module"> 19 test(t => { 20 assert_array_equals(log, []); 21 }, 'The URL after mapping violates CSP (but not the URL before mapping)'); 22 </script> 23 24 <script type="module"> 25 import 'https://{{domains[www1]}}:{{ports[https][0]}}/import-maps/resources/log.js?pipe=sub&name=C'; 26 </script> 27 <script type="module"> 28 test(t => { 29 assert_array_equals(log, ["log:D"]); 30 }, 'The URL before mapping violates CSP (but not the URL after mapping)'); 31 </script>