You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maintain a string definition and avoid hono's secureHeaders middleware and it's type checking.
Pass an object to hono's secureHeaders middleware and separately maintain and keep in sync an equivalent string definition.
Duplicate code inside hono's secure-headers.ts file and hope I don't introduce bugs.
Install an npm library like content-security-policy-builder from helmetjs that duplicates hono's stringification code (if it even turns out to be compatible with the secureHeaders format).
Use an npm library like content-security-policy-builder and write a custom hono middleware that duplicate's honos secureHeaders's 200+ lines of TS types and code.
Would anyone be interested in a PR that exports hono's stringification abilities? Is anyone even using Content-Security-Policy with hono on Cloudflare Workers?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'd love it if the secureHeaders middleware exported it's internal stringification functions for re-use such as
getPermissionsPolicyDirectives.My use case is running hono on Cloudflare Workers. To test my permissions policy locally, I have to use this pattern in vite.config.ts.
Currently, my choices include:
secureHeadersmiddleware and it's type checking.secureHeadersmiddleware and separately maintain and keep in sync an equivalent string definition.secure-headers.tsfile and hope I don't introduce bugs.content-security-policy-builderfrom helmetjs that duplicates hono's stringification code (if it even turns out to be compatible with thesecureHeadersformat).content-security-policy-builderand write a custom hono middleware that duplicate's honossecureHeaders's 200+ lines of TS types and code.Would anyone be interested in a PR that exports hono's stringification abilities? Is anyone even using
Content-Security-Policywith hono on Cloudflare Workers?Beta Was this translation helpful? Give feedback.
All reactions