Sisk

Class

CrossOriginResourceSharingHeaders

Namespace
Sisk.Core.Entity
Assembly
Sisk.Core.dll

Provides a class to provide Cross Origin response headers for when communicating with a browser.

C#
public sealed class CrossOriginResourceSharingHeaders

Inheritance #

object ← CrossOriginResourceSharingHeaders

Inherited Members #

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors #

NameDescription
CrossOriginResourceSharingHeaders()Creates an empty CrossOriginResourceSharingHeaders instance with no predefined CORS headers.
CrossOriginResourceSharingHeaders(string?, string[]?, string[]?, string[]?, string[]?, TimeSpan?, bool)Initializes a new instance of the CrossOriginResourceSharingHeaders class with the specified CORS headers.

Fields #

NameDescription
AutoAllowOriginWhen applied to the AllowOrigin property, the HTTP server automatically applies the incoming request Origin header value to the Access-Control-Allow-Origin header.
AutoFromRequestHeadersWhen applied to the AllowHeaders property, the HTTP server automatically applies the incoming request headers to the Access-Control-Allow-Origin header.
AutoFromRequestMethodWhen applied to the AllowMethods property, the HTTP server automatically applies the incoming request method to the Access-Control-Allow-Origin header.

Properties #

NameDescription
AllowCredentialsGets or sets the Access-Control-Allow-Credentials header indicates whether or not the response to the request can be exposed when the credentials flag is true. When used as part of a response to a preflight request, this indicates whether or not the actual request can be made using credentials.
AllowHeadersGets or sets the Access-Control-Allow-Headers header is used in response to a preflight request to indicate which HTTP headers can be used when making the actual request.
AllowMethodsGets or sets the Access-Control-Allow-Methods header specifies the method or methods allowed when accessing the resource.
AllowOriginFrom MDN: Access-Control-Allow-Origin specifies either a single origin which tells browsers to allow that origin to access the resource; or else — for requests without credentials — the “*” wildcard tells browsers to allow any origin to access the resource.
AllowOriginsGets or sets domains which will define the source header according to one of the domains present below.
EmptyGets an instance of an empty CrossOriginResourceSharingHeaders.
ExposeHeadersGets or sets the Access-Control-Expose-Headers header adds the specified headers to the allowlist that JavaScript in browsers is allowed to access.
MaxAgeGets or sets the Access-Control-Max-Age header indicates how long the results of a preflight request can be cached.

Methods #

NameDescription
CreatePublicContext()Create an instance of Cross-Origin Resource Sharing that allows any origin, any method and any header in the request.

Type to search the documentation and the API reference.