优化h5跨域请求设置

This commit is contained in:
JianWeie
2021-06-02 14:55:29 +08:00
parent e1921b3cbf
commit 106914fa74
2 changed files with 11 additions and 3 deletions
+4 -3
View File
@@ -33,9 +33,10 @@ namespace CoreCms.Net.Core.Config
{
c.AddPolicy(AppSettingsConstVars.CorsPolicyName, policy =>
{
policy.WithOrigins(AppSettingsConstVars.CorsIPs.Split(','))
.AllowAnyHeader()//Ensures that the policy allows any header.
.AllowAnyMethod();
policy.WithOrigins(AppSettingsConstVars.CorsIPs.Split(','));
policy.AllowAnyHeader();//Ensures that the policy allows any header.
policy.AllowAnyMethod();
policy.AllowCredentials();
});
}
else