ToolypetMCP
intermediate4 minutescross hub

CORS + CSP Integration Test

Generate CORS headers, create matching CSP, and evaluate the combined security policy for consistency.

corscspintegrationsecurity-headers

このレシピの使いどころ

CORS and CSP must work together. Mismatched policies cause broken features or security gaps. This recipe ensures both policies are consistent and complete.

ステップ

1

Define CORS policy

プロンプト:Generate CORS headers allowing https://app.mysite.com and https://admin.mysite.com with credentials
2

Create matching CSP

プロンプト:Generate CSP that aligns with the CORS origins: allow connect-src to the same origins
3

Verify policy consistency

プロンプト:Evaluate the CSP for consistency with CORS origins and check for security gaps
4

Security Header Checker

このツールを試す

Full header audit

プロンプト:Check all security headers together for conflicts and missing protections

よくある質問

Can CORS and CSP conflict?

Yes. If CORS allows an origin but CSP blocks it via connect-src, fetch requests will fail. Always align connect-src in CSP with CORS allowed origins.

Do I need both CORS and CSP?

Yes. CORS controls which origins can make requests TO your API. CSP controls what resources your page can load FROM other origins. They protect different attack vectors.

関連レシピ