File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
dotnet/src/dotnetcore/GxNetCoreStartup Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -206,12 +206,17 @@ private void DefineCorsPolicy(IServiceCollection services)
206206 string corsAllowedOrigins = Preferences . CorsAllowedOrigins ( ) ;
207207 if ( ! string . IsNullOrEmpty ( corsAllowedOrigins ) )
208208 {
209+ string [ ] origins = corsAllowedOrigins . Split ( ',' , StringSplitOptions . TrimEntries | StringSplitOptions . RemoveEmptyEntries ) ;
210+ foreach ( string origin in origins )
211+ {
212+ GXLogging . Info ( log , $ "Adding origin to CORS policy:", origin ) ;
213+ }
209214 services . AddCors ( options =>
210215 {
211216 options . AddPolicy ( name : CORS_POLICY_NAME ,
212217 policy =>
213218 {
214- policy . WithOrigins ( corsAllowedOrigins . Split ( ',' , StringSplitOptions . RemoveEmptyEntries ) ) ;
219+ policy . WithOrigins ( origins ) ;
215220 if ( ! corsAllowedOrigins . Contains ( CORS_ANY_ORIGIN ) )
216221 {
217222 policy . AllowCredentials ( ) ;
You can’t perform that action at this time.
0 commit comments