feat: add support for CSP (#72)
This commit adds support for running with CSP. CSP can be enabled on a per page basis. If this is done, fresh will set a default CSP that is very restrictive. Users can modify the CSP with the `useCSP` hook. Fresh will add its own script resources to the CSP automatically.
This commit is contained in:
@@ -40,4 +40,12 @@ export interface PageConfig {
|
||||
* The route override must be a path-to-regexp compatible route matcher.
|
||||
*/
|
||||
routeOverride?: string;
|
||||
|
||||
/**
|
||||
* If Content-Security-Policy should be enabled for this page. If 'true', a
|
||||
* locked down policy will be used that allows only the scripts and styles
|
||||
* that are generated by fresh. Additional scripts and styles can be added
|
||||
* using `useCSP` hook.
|
||||
*/
|
||||
csp?: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user