1 write to Origins
Microsoft.AspNetCore.Cors.Test (1)
CorsServiceTests.cs (1)
21Origins = { "*" },
68 references to Origins
Microsoft.AspNetCore.Cors (14)
Infrastructure\CorsPolicy.cs (5)
65if (Origins == null || Origins.Count != 1 || Origins[0] != CorsConstants.AnyOrigin) 161builder.AppendJoin(",", Origins); 177return Origins.Contains(origin, StringComparer.Ordinal);
Infrastructure\CorsPolicyBuilder.cs (6)
40/// This method normalizes the origin value prior to adding it to <see cref="CorsPolicy.Origins"/> to match 46/// Finally, the scheme and punycoded host name are culture invariant lower cased before being added to the <see cref="CorsPolicy.Origins"/> 61_policy.Origins.Add(normalizedOrigin); 162_policy.Origins.Clear(); 163_policy.Origins.Add(CorsConstants.AnyOrigin); 247WithOrigins(policy.Origins.ToArray());
Infrastructure\CorsPolicyExtensions.cs (2)
14if (policy.Origins.Contains(origin)) 21return policy.Origins
Infrastructure\CorsService.cs (1)
109result.VaryByOrigin = policy.Origins.Count > 1 || !policy.IsDefaultIsOriginAllowed;
Microsoft.AspNetCore.Cors.Test (54)
CorsMiddlewareTests.cs (2)
113policy.Origins.Add(OriginUrl); 160policy.Origins.Add(OriginUrl);
CorsPolicyBuilderTests.cs (15)
14originalPolicy.Origins.Add("http://existing.com"); 36Assert.NotSame(originalPolicy.Origins, corsPolicy.Origins); 37Assert.Equal(originalPolicy.Origins, corsPolicy.Origins); 49originalPolicy.Origins.Add("http://existing.com"); 61Assert.NotSame(originalPolicy.Origins, corsPolicy.Origins); 62Assert.Equal(originalPolicy.Origins, corsPolicy.Origins); 83Assert.Empty(corsPolicy.Origins); 107Assert.Equal(origins.ToList(), corsPolicy.Origins); 123Assert.Equal(new List<string>() { "http://example.com", "http://example2.com" }, corsPolicy.Origins); 134Assert.Equal(new List<string>() { "http://www.example.com", "https://example2.com" }, corsPolicy.Origins); 171Assert.Equal(new List<string>() { "*" }, corsPolicy.Origins);
CorsPolicyExtensionsTests.cs (4)
14policy.Origins.Add(origin); 34policy.Origins.Add("http://*.domain"); 52policy.Origins.Add(allowedOrigin); 73policy.Origins.Add(allowedOrigin);
CorsPolicyTests.cs (3)
22Assert.Empty(corsPolicy.Origins); 70corsPolicy.Origins.Add("http://example.com"); 71corsPolicy.Origins.Add("http://example.org");
CorsServiceTests.cs (30)
54policy.Origins.Add("bar"); 88policy.Origins.Add("example.com"); 109policy.Origins.Add(CorsConstants.AnyOrigin); 125policy.Origins.Add(CorsConstants.AnyOrigin); 144policy.Origins.Add(CorsConstants.AnyOrigin); 163policy.Origins.Add("http://example.com"); 179policy.Origins.Add(CorsConstants.AnyOrigin); 196policy.Origins.Add("http://example.com"); 213policy.Origins.Add("http://example.com"); 214policy.Origins.Add("http://api.example.com"); 248policy.Origins.Add(CorsConstants.AnyOrigin); 264policy.Origins.Add(CorsConstants.AnyOrigin); 281policy.Origins.Add(CorsConstants.AnyOrigin); 300policy.Origins.Add(CorsConstants.AnyOrigin); 317policy.Origins.Add(CorsConstants.AnyOrigin); 340policy.Origins.Add(CorsConstants.AnyOrigin); 341policy.Origins.Add("http://example.com"); 383policy.Origins.Add("http://example.com"); 403policy.Origins.Add(CorsConstants.AnyOrigin); 423policy.Origins.Add(CorsConstants.AnyOrigin); 440policy.Origins.Add(CorsConstants.AnyOrigin); 462policy.Origins.Add(CorsConstants.AnyOrigin); 480policy.Origins.Add(CorsConstants.AnyOrigin); 503policy.Origins.Add(CorsConstants.AnyOrigin); 526policy.Origins.Add(CorsConstants.AnyOrigin); 546policy.Origins.Add("http://example.com"); 909policy.Origins.Add("http://example.com"); 910policy.Origins.Add("http://example-two.com"); 927policy.Origins.Add("http://example-two.com"); 928policy.Origins.Add("http://example-three.com");