Skip to content

Implement CSP #459

@arthurfiorette

Description

@arthurfiorette

Hono/jsx supports adding CSP headerst to the final script added https://hono.dev/docs/guides/jsx#streamingcontext

Ideally we could also implement the same by simply setting a optional cspNonce optional value in the request context and later inject it in the SuspenseScript.

This could be added automatically or a custom value set by the user

In the fastify plugin, we could either implement this natively or use the fastify-helmet module to generate those on the fly with enableCspNonces: true

https://github.com/fastify/fastify-helmet#example---generate-by-options

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions