-
Notifications
You must be signed in to change notification settings - Fork 0
Improve security headers #16
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,7 +21,7 @@ COPY --from=deps /app/node_modules ./node_modules | |||||
| COPY . . | ||||||
|
|
||||||
| # Install all dependencies (including dev) for build | ||||||
| RUN npm install | ||||||
| RUN npm install --ignore-scripts | ||||||
|
||||||
| RUN npm install --ignore-scripts | |
| RUN npm install |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,40 @@ | ||||||||||||||||
| import { NextRequest, NextResponse } from "next/server"; | ||||||||||||||||
|
|
||||||||||||||||
| export function proxy(request: NextRequest) { | ||||||||||||||||
pedrordgs marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||
| const nonce = Buffer.from(crypto.randomUUID()).toString("base64"); | ||||||||||||||||
|
Comment on lines
+2
to
+4
|
||||||||||||||||
| export function proxy(request: NextRequest) { | |
| const nonce = Buffer.from(crypto.randomUUID()).toString("base64"); | |
| import { randomBytes } from "crypto"; | |
| export function proxy(request: NextRequest) { | |
| const nonce = randomBytes(16).toString("base64"); |
Copilot
AI
Jan 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CSP header does not include connect-src directive, which defaults to default-src 'self'. This might be too restrictive if the application needs to make API calls to external services. Consider explicitly setting connect-src to match your application's requirements.
Additionally, consider adding other security directives like worker-src, manifest-src, and media-src if the application uses service workers, web manifests, or media resources.
| frame-ancestors 'none'; | |
| frame-ancestors 'none'; | |
| connect-src 'self'; | |
| worker-src 'self'; | |
| manifest-src 'self'; | |
| media-src 'self'; |
Uh oh!
There was an error while loading. Please reload this page.