Skip to content

Instantly share code, notes, and snippets.

@donma
Created February 13, 2025 08:33
Show Gist options
  • Select an option

  • Save donma/fa94cb72ae0da3cd9407bd0229104d5c to your computer and use it in GitHub Desktop.

Select an option

Save donma/fa94cb72ae0da3cd9407bd0229104d5c to your computer and use it in GitHub Desktop.
options.AddPolicy("SecurePolicy",
policy => policy.WithOrigins("https://yourdomain.com") // 限制特定網域
.AllowMethods("GET", "POST") // 只允許 GET 和 POST
.AllowHeaders("Content-Type", "Authorization")); // 只允許特定標頭
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment