1 write to Origins
Microsoft.AspNetCore.Cors.Test (1)
CorsServiceTests.cs (1)
21
Origins
= { "*" },
68 references to Origins
Microsoft.AspNetCore.Cors (14)
Infrastructure\CorsPolicy.cs (5)
65
if (
Origins
== null ||
Origins
.Count != 1 ||
Origins
[0] != CorsConstants.AnyOrigin)
161
builder.AppendJoin(",",
Origins
);
177
return
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);
247
WithOrigins(policy.
Origins
.ToArray());
Infrastructure\CorsPolicyExtensions.cs (2)
14
if (policy.
Origins
.Contains(origin))
21
return policy.
Origins
Infrastructure\CorsService.cs (1)
109
result.VaryByOrigin = policy.
Origins
.Count > 1 || !policy.IsDefaultIsOriginAllowed;
Microsoft.AspNetCore.Cors.Test (54)
CorsMiddlewareTests.cs (2)
113
policy.
Origins
.Add(OriginUrl);
160
policy.
Origins
.Add(OriginUrl);
CorsPolicyBuilderTests.cs (15)
14
originalPolicy.
Origins
.Add("http://existing.com");
36
Assert.NotSame(originalPolicy.
Origins
, corsPolicy.
Origins
);
37
Assert.Equal(originalPolicy.
Origins
, corsPolicy.
Origins
);
49
originalPolicy.
Origins
.Add("http://existing.com");
61
Assert.NotSame(originalPolicy.
Origins
, corsPolicy.
Origins
);
62
Assert.Equal(originalPolicy.
Origins
, corsPolicy.
Origins
);
83
Assert.Empty(corsPolicy.
Origins
);
107
Assert.Equal(origins.ToList(), corsPolicy.
Origins
);
123
Assert.Equal(new List<string>() { "http://example.com", "http://example2.com" }, corsPolicy.
Origins
);
134
Assert.Equal(new List<string>() { "http://www.example.com", "https://example2.com" }, corsPolicy.
Origins
);
171
Assert.Equal(new List<string>() { "*" }, corsPolicy.
Origins
);
CorsPolicyExtensionsTests.cs (4)
14
policy.
Origins
.Add(origin);
34
policy.
Origins
.Add("http://*.domain");
52
policy.
Origins
.Add(allowedOrigin);
73
policy.
Origins
.Add(allowedOrigin);
CorsPolicyTests.cs (3)
22
Assert.Empty(corsPolicy.
Origins
);
70
corsPolicy.
Origins
.Add("http://example.com");
71
corsPolicy.
Origins
.Add("http://example.org");
CorsServiceTests.cs (30)
54
policy.
Origins
.Add("bar");
88
policy.
Origins
.Add("example.com");
109
policy.
Origins
.Add(CorsConstants.AnyOrigin);
125
policy.
Origins
.Add(CorsConstants.AnyOrigin);
144
policy.
Origins
.Add(CorsConstants.AnyOrigin);
163
policy.
Origins
.Add("http://example.com");
179
policy.
Origins
.Add(CorsConstants.AnyOrigin);
196
policy.
Origins
.Add("http://example.com");
213
policy.
Origins
.Add("http://example.com");
214
policy.
Origins
.Add("http://api.example.com");
248
policy.
Origins
.Add(CorsConstants.AnyOrigin);
264
policy.
Origins
.Add(CorsConstants.AnyOrigin);
281
policy.
Origins
.Add(CorsConstants.AnyOrigin);
300
policy.
Origins
.Add(CorsConstants.AnyOrigin);
317
policy.
Origins
.Add(CorsConstants.AnyOrigin);
340
policy.
Origins
.Add(CorsConstants.AnyOrigin);
341
policy.
Origins
.Add("http://example.com");
383
policy.
Origins
.Add("http://example.com");
403
policy.
Origins
.Add(CorsConstants.AnyOrigin);
423
policy.
Origins
.Add(CorsConstants.AnyOrigin);
440
policy.
Origins
.Add(CorsConstants.AnyOrigin);
462
policy.
Origins
.Add(CorsConstants.AnyOrigin);
480
policy.
Origins
.Add(CorsConstants.AnyOrigin);
503
policy.
Origins
.Add(CorsConstants.AnyOrigin);
526
policy.
Origins
.Add(CorsConstants.AnyOrigin);
546
policy.
Origins
.Add("http://example.com");
909
policy.
Origins
.Add("http://example.com");
910
policy.
Origins
.Add("http://example-two.com");
927
policy.
Origins
.Add("http://example-two.com");
928
policy.
Origins
.Add("http://example-three.com");