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
MethodsIReadOnlyList<string>The HTTP methods allowed for CORS requests (e.g., GET, PUT, POST, DELETE, HEAD).
OriginsIReadOnlyList<string>The origins allowed to make CORS requests (e.g., "https://example.com", "*").
HeadersIReadOnlyList<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
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
Origins
The origins allowed to make CORS requests (e.g., "https://example.com", "*").
[JsonPropertyName("origins")]
public IReadOnlyList<string> Origins { get; init; }