Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Added CSP headers to next app for testing what we document #1528

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions playground/nextjs/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ export default function App({ Component, pageProps }: AppProps) {
<Head>
<title>PostHog</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
{/* CSP - useful for testing our documented recommendations. NOTE: Unsafe is only needed for nextjs pre-loading */}
<meta
http-equiv="Content-Security-Policy"
content={`
default-src 'self';
connect-src 'self' http://localhost:8000 https://*.posthog.com;
benjackwhite marked this conversation as resolved.
Show resolved Hide resolved
script-src 'self' 'unsafe-eval' 'unsafe-inline' http://localhost:8000 https://*.posthog.com;
style-src 'self' 'unsafe-inline' http://localhost:8000 https://*.posthog.com;
img-src 'self' http://localhost:8000 https://*.posthog.com;
`}
/>
</Head>

<main>
Expand Down
Loading