Table of Contents

Class CorsAllowed

Namespace
Cloudflare.NET.Accounts.Models
Assembly
Cloudflare.NET.dll

Defines the allowed HTTP methods, origins, and headers for a CORS rule.

public record CorsAllowed : IEquatable<CorsAllowed>
Inheritance
CorsAllowed
Implements
Inherited Members

Constructors

CorsAllowed(IReadOnlyList<string>, IReadOnlyList<string>, IReadOnlyList<string>?)

Defines the allowed HTTP methods, origins, and headers for a CORS rule.

public CorsAllowed(IReadOnlyList<string> Methods, IReadOnlyList<string> Origins, IReadOnlyList<string>? Headers = null)

Parameters

Methods IReadOnlyList<string>

The HTTP methods allowed for CORS requests (e.g., GET, PUT, POST, DELETE, HEAD).

Origins IReadOnlyList<string>

The origins allowed to make CORS requests (e.g., "https://example.com", "*").

Headers IReadOnlyList<string>

The headers that are allowed in CORS requests (e.g., "Content-Type", "Authorization").

Properties

Headers

The headers that are allowed in CORS requests (e.g., "Content-Type", "Authorization").

[JsonPropertyName("headers")]
public IReadOnlyList<string>? Headers { get; init; }

Property Value

IReadOnlyList<string>

Methods

The HTTP methods allowed for CORS requests (e.g., GET, PUT, POST, DELETE, HEAD).

[JsonPropertyName("methods")]
public IReadOnlyList<string> Methods { get; init; }

Property Value

IReadOnlyList<string>

Origins

The origins allowed to make CORS requests (e.g., "https://example.com", "*").

[JsonPropertyName("origins")]
public IReadOnlyList<string> Origins { get; init; }

Property Value

IReadOnlyList<string>