AllowedOrigins class sealed

Which origins a browser may call this server from.

A browser sends Origin and refuses the response unless the server names that origin back. Everything else in CORS follows from that one exchange.

Constructors

AllowedOrigins.any()
Any origin at all, answered as *.
const
factory
AllowedOrigins.matching(bool predicate(String origin))
Whatever predicate accepts, for a rule a list cannot express.
const
factory
AllowedOrigins.only(Set<String> origins)
Exactly these origins, compared case-sensitively as the specification requires — https://Example.com is not https://example.com.
const
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
varies → bool
Whether the answer depends on the request, and so needs Vary: Origin.
no setter

Methods

headerFor(String? origin) → String?
What to answer for origin, or null to refuse it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited