tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

csp-pass.https.window.js (613B)


      1 // META: global=window,worker
      2 // META: script=/common/get-host-info.sub.js
      3 // META: script=resources/webtransport-test-helpers.sub.js
      4 
      5 function set_csp(destination) {
      6  let meta = document.createElement('meta');
      7  meta.httpEquiv = 'Content-Security-Policy';
      8  meta.content = `connect-src ${destination}`;
      9  return meta;
     10 }
     11 
     12 promise_test(async t => {
     13 let meta = set_csp(`${BASE}`);
     14 document.head.appendChild(meta);
     15 
     16  let wt = new WebTransport(webtransport_url('custom-response.py?:status=200'));
     17  await wt.ready;
     18 }, 'WebTransport connection should succeed when CSP connect-src destination is set to the page');