Class CorsRule
- Namespace
- Cloudflare.NET.Accounts.Models
- Assembly
- Cloudflare.NET.dll
Represents a single CORS rule for an R2 bucket.
public record CorsRule : IEquatable<CorsRule>
- Inheritance
-
CorsRule
- Implements
- Inherited Members
Constructors
CorsRule(CorsAllowed, string?, IReadOnlyList<string>?, int?)
Represents a single CORS rule for an R2 bucket.
public CorsRule(CorsAllowed Allowed, string? Id = null, IReadOnlyList<string>? ExposeHeaders = null, int? MaxAgeSeconds = null)
Parameters
AllowedCorsAllowedThe allowed methods, origins, and headers for this rule.
IdstringAn optional identifier for this CORS rule.
ExposeHeadersIReadOnlyList<string>Headers that browsers are allowed to access in the response.
MaxAgeSecondsint?How long the browser should cache the preflight response, in seconds.
Properties
Allowed
The allowed methods, origins, and headers for this rule.
[JsonPropertyName("allowed")]
public CorsAllowed Allowed { get; init; }
Property Value
ExposeHeaders
Headers that browsers are allowed to access in the response.
[JsonPropertyName("exposeHeaders")]
public IReadOnlyList<string>? ExposeHeaders { get; init; }
Property Value
Id
An optional identifier for this CORS rule.
[JsonPropertyName("id")]
public string? Id { get; init; }
Property Value
MaxAgeSeconds
How long the browser should cache the preflight response, in seconds.
[JsonPropertyName("maxAgeSeconds")]
public int? MaxAgeSeconds { get; init; }
Property Value
- int?