Table of Contents

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

Allowed CorsAllowed

The allowed methods, origins, and headers for this rule.

Id string

An optional identifier for this CORS rule.

ExposeHeaders IReadOnlyList<string>

Headers that browsers are allowed to access in the response.

MaxAgeSeconds int?

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

CorsAllowed

ExposeHeaders

Headers that browsers are allowed to access in the response.

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

Property Value

IReadOnlyList<string>

Id

An optional identifier for this CORS rule.

[JsonPropertyName("id")]
public string? Id { get; init; }

Property Value

string

MaxAgeSeconds

How long the browser should cache the preflight response, in seconds.

[JsonPropertyName("maxAgeSeconds")]
public int? MaxAgeSeconds { get; init; }

Property Value

int?