Method Restricting
- Namespace
- MailFathom.Infrastructure.Security.Transport
- Assembly
- MailFathom.Infrastructure.dll
Restricting(IEnumerable<string>)
Creates a policy that serves an exact set of origins.
public static McpOriginPolicy Restricting(IEnumerable<string> allowedOrigins)
Parameters
allowedOriginsIEnumerable<string>The configured origins, which must already have passed TryNormalize(string?, out string).
Returns
- McpOriginPolicy
The restricting policy.
Exceptions
- ArgumentNullException
Thrown when
allowedOriginsis null.- ArgumentException
Thrown when
allowedOriginsis empty; serving no browser at all is ServingNoBrowserOrigin, which says so by its name rather than by a list that happens to be short.