Skip to content

strict-dynamic CSP support #3558

Open
Open
@Rich-Harris

Description

@Rich-Harris

Describe the problem

SvelteKit doesn't really work with strict-dynamic CSP, at least not when using hashes. There seem to be some non-intuitive requirements (you have to use modulepreload?), and I haven't been able to get it to work at all in Firefox, so I more or less gave up on it in #3499.

Describe the proposed solution

Err, not sure. But this...

// svelte.config.js
export default {
  kit: {
    csp: {
      directives: {
        'default-src': ['strict-dynamic']
      }
    }
  }
};

...needs to work in dev and prod somehow.

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions