https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 9e34bb15e5b4662e9d59ec01e9d0e228e49b44ee authored by Jake Archibald on 06 April 2018, 15:33:01 UTC
Testing range header is actually sent to the server
Tip revision: 9e34bb1
connect-src-websocket-blocked.sub.html
<!DOCTYPE html>
<html>

<head>
    <!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncracies.-->
    <meta http-equiv="Content-Security-Policy" content="connect-src 'self' ws://127.0.0.1:8880; script-src 'self' 'unsafe-inline';">
    <title>connect-src-websocket-blocked</title>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <script src='../support/logTest.sub.js?logs=["Pass","violated-directive=connect-src"]'></script>
    <script src="../support/alertAssert.sub.js?alerts=[]"></script>
</head>

<body>
    <script>
        window.addEventListener('securitypolicyviolation', function(e) {
            log("violated-directive=" + e.violatedDirective);
        });

        try {
            var ws = new WebSocket("ws://localhost:8880/echo");
            log("Fail");
        } catch (e) {
            log("Pass");
        }

    </script>
    <div id="log"></div>
</body>

</html>
back to top