Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Enforce Space content security policy

Anand Baburajan84bd2b770018
diff --git a/web/apps/space/public/_headers b/web/apps/space/public/_headers
index f4160b9b2f..cd79a9b032 100644
--- a/web/apps/space/public/_headers
+++ b/web/apps/space/public/_headers
@@ -8,4 +8,4 @@
X-XSS-Protection: 1; mode=block
Referrer-Policy: no-referrer
Reporting-Endpoints: csp-endpoint="https://csp-reporter.ente.io"
- Content-Security-Policy-Report-Only: default-src 'self'; img-src 'self' blob: data:; media-src 'self' blob: data:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self' 'unsafe-eval' 'wasm-unsafe-eval' blob:; worker-src 'self' blob:; manifest-src 'self'; child-src 'self' blob:; object-src 'none'; connect-src 'self' https://*.ente.com https://*.ente.io https://space-api.ente-dev.com data: blob: https://*.s3.eu-central-003.backblazeb2.com https://*.s3.eu-central-2.wasabisys.com; base-uri 'self'; frame-ancestors 'none'; form-action 'none'; report-uri https://csp-reporter.ente.io; report-to csp-endpoint;
+ Content-Security-Policy: default-src 'self'; img-src 'self' blob: data:; media-src 'self' blob: data:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self' 'wasm-unsafe-eval'; worker-src 'self' blob:; manifest-src 'self'; child-src 'self' blob:; object-src 'none'; connect-src 'self' https://*.ente.com https://*.ente.io https://space-api.ente-dev.com data: blob: https://*.s3.eu-central-003.backblazeb2.com https://*.s3.eu-central-2.wasabisys.com; base-uri 'self'; frame-ancestors 'none'; form-action 'none'; report-uri https://csp-reporter.ente.io; report-to csp-endpoint;
diff --git a/web/apps/space/src/configureZod.ts b/web/apps/space/src/configureZod.ts
new file mode 100644
index 0000000000..5f6bfadc73
--- /dev/null
+++ b/web/apps/space/src/configureZod.ts
@@ -0,0 +1,3 @@
+import { config } from "zod";
+
+config({ jitless: true });
diff --git a/web/apps/space/src/pages/_app.tsx b/web/apps/space/src/pages/_app.tsx
index f725ae37ba..de8d0715aa 100644
--- a/web/apps/space/src/pages/_app.tsx
+++ b/web/apps/space/src/pages/_app.tsx
@@ -3,6 +3,7 @@ import "@fontsource/nunito/800.css";
import { CssBaseline } from "@mui/material";
import { ThemeProvider } from "@mui/material/styles";
import { SpaceRouteTransitionBoundary } from "components/SpaceRouteTransitionBoundary";
+import "configureZod";
import { CustomHead } from "ente-base/components/Head";
import { useSetupLogs } from "ente-base/components/utils/hooks-app";
import { shareTheme } from "ente-base/components/utils/theme";