Path: redb-route/redb.Route.Http/HttpCorsOptions.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route.Http/HttpCorsOptions.cs
----
namespace redb.Route.Http;
///
/// Global CORS configuration for HTTP components.
/// Applied as defaults to all HTTP consumers unless overridden at the endpoint level.
/// Usage: services.AddRedbRouteHttp(cors => { cors.Enabled = true; cors.Origins = "https://example.com"; });
///
public class HttpCorsOptions
{
/// Enable CORS for all HTTP consumers. Default: false.
public bool Enabled { get; set; }
///
/// Allowed origins (comma-separated). Default: * when CORS is enabled.
/// Example: "https://example.com,https://app.example.com"
///
public string? Origins { get; set; }
///
/// Enable Access-Control-Allow-Credentials header. Default: false.
/// When true, Origins must be set to a specific origin (not *).
///
public bool Credentials { get; set; }
///
/// Optional global per-request CORS-origin resolver applied as a default to all HTTP
/// consumers that do not set their own .
/// See for the contract.
///
public Func? OriginsResolver { get; set; }
}