Skip to content

fix form#1863

Open
mohab-sameh wants to merge 1 commit intomainfrom
website/fix-form-cors
Open

fix form#1863
mohab-sameh wants to merge 1 commit intomainfrom
website/fix-form-cors

Conversation

@mohab-sameh
Copy link
Contributor

fixes newsletter form security policy

Copilot AI review requested due to automatic review settings November 11, 2025 18:36
@vercel
Copy link

vercel bot commented Nov 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
codemod Ready Ready Preview Comment Nov 11, 2025 6:43pm

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 11, 2025

Open in StackBlitz

npm i https://pkg.pr.new/codemod@1863

commit: 52a73ac

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR consolidates Content Security Policy (CSP) configuration by removing the duplicate CSP headers from next.config.mjs and updating the existing middleware CSP to support Google reCAPTCHA for the newsletter form.

  • Removed the CSP configuration from next.config.mjs to avoid duplication with middleware
  • Added Google reCAPTCHA domains to script-src, frame-src, and img-src directives in middleware
  • Added Google domain variants to img-src for reCAPTCHA image assets

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/frontend/next.config.mjs Removed duplicate CSP headers configuration that conflicted with middleware implementation
apps/frontend/middleware.ts Updated CSP directives to include Google reCAPTCHA URLs for script execution, iframe embedding, and image loading

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

connect-src *.google-analytics.com https://clerk.codemod.com https://api.short.io https://backend.codemod.com https://codemod.com https://vitals.vercel-insights.com https://summary-walrus-25.clerk.accounts.dev https://*.vercel.app https://vercel.live wss://backend.codemod.com wss://*.api.sanity.io ${codehikeUrls} ${analyticsUrls};
style-src 'self' 'unsafe-inline' https://vercel.live;
img-src 'self' blob: data: https://*.google-analytics.com https://*.googletagmanager.com https://img.clerk.com https://cdn.sanity.io https://image.mux.com https://vercel.com https://avatars.githubusercontent.com;
img-src 'self' blob: data: https://*.google-analytics.com https://*.googletagmanager.com https://www.google.com https://www.google.com.eg https://*.google.com https://*.google.com.eg https://img.clerk.com https://cdn.sanity.io https://image.mux.com https://vercel.com https://avatars.githubusercontent.com;
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The img-src directive includes redundant Google domains. https://*.google.com already covers https://www.google.com, and https://*.google.com.eg already covers https://www.google.com.eg. Consider removing the redundant specific domains to simplify the CSP policy.

Suggested change
img-src 'self' blob: data: https://*.google-analytics.com https://*.googletagmanager.com https://www.google.com https://www.google.com.eg https://*.google.com https://*.google.com.eg https://img.clerk.com https://cdn.sanity.io https://image.mux.com https://vercel.com https://avatars.githubusercontent.com;
img-src 'self' blob: data: https://*.google-analytics.com https://*.googletagmanager.com https://*.google.com https://*.google.com.eg https://img.clerk.com https://cdn.sanity.io https://image.mux.com https://vercel.com https://avatars.githubusercontent.com;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant