Open
Description
At least in theory ws/wss cannot show up in CSP (they get mapped to http/https before CSP is involved). If they do show up there's a problem of sorts with Fetch integration. (Probably best discussed in a separate issue.)
I just validated this assumption (before removal in https://bugzilla.mozilla.org/show_bug.cgi?id=1742366). It turns out to not be unconditionally true.
data:text/html,<meta http-equiv="content-security-policy" content="connect-src;">
<script>
document.onsecuritypolicyviolation=e=>alert(e.blockedURI);
new WebSocket("ws://httpbingo.org/redirect-to?url=https://example.com")</script>
in Firefox 96.0a1, the result is ws://httpbingo.org/redirect-to?url=https://example.com
In Chromium 95, the result is ws://httpbingo.org
We should therefore also accept ws(s) and not trim it to the scheme. And have a WPT for it.
Originally posted by @Rob--W in #527 (comment)