Files
tiku-backend.net/Tiku.Api/Options/CorsOptions.cs
xiong c497a3ca8d
Some checks failed
ci / release-gate (push) Has been cancelled
清理代码
2026-08-03 12:31:39 +08:00

21 lines
598 B
C#

using System.ComponentModel.DataAnnotations;
namespace Tiku.Api.Options;
public sealed class CorsOptions
{
public const string SectionName = "Cors";
public const string PolicyName = "TikuCors";
[Required] public string[] AllowedOrigins { get; set; } = [];
[Required]
[MinLength(1)]
public string[] AllowedHeaders { get; set; } = ["Authorization", "Content-Type", "x-tenant-code"];
[Required]
[MinLength(1)]
public string[] AllowedMethods { get; set; } = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"];
public bool AllowCredentials { get; set; }
}