Skip to content

CSP: Document http->https, and wss being allowed in 'self' #36168

@wbamberg

Description

@wbamberg

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/connect-src has a note:

Screen Shot 2024-10-02 at 12 00 50 PM

This is I think out of date but it refers to an interesting spec change that we should document: w3c/webappsec-csp@0e81d81.

http: is not equivalent to http: https:, and ws: to ws: wss:.
Likewise, handling for 'self' now includes https: and wss: on
the protected resource's host.

(I think "not" above should be "now")

The idea I think is that:

  • if you specify http: as the scheme in a source expression, the browser will allow https:
  • if you specify ws: as the scheme in a source expression, the browser will allow wss:
  • if you specify 'self' in a source expression, then wss: is allowed for the scheme if the rest of the origin matches

Metadata

Metadata

Assignees

No one assigned

    Labels

    Content:HTTPHTTP docshelp wantedIf you know something about this topic, we would love your help!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions