ZhiYi/ZhiYi.Core.Api/ServerConfig/KestrelOptions.cs

48 lines
1.4 KiB
C#
Raw Permalink Normal View History

2025-02-21 01:14:39 +00:00
using static ZhiYi.Core.Api.ServerConfig.KestrelOptions.Endpoint;
namespace ZhiYi.Core.Api.ServerConfig
{
public class KestrelOptions
{
/// <summary>
/// Gets or sets the endpoints for the Kestrel server.
/// </summary>
public IDictionary<string, Endpoint> Endpoints { get; init; } = new Dictionary<string, Endpoint>();
/// <summary>
/// 文件大小限制配置
/// </summary>
public KestrelLimitsOptions Limits { get; set; }
/// <summary>
/// Represents an endpoint for the Kestrel server.
/// </summary>
public class Endpoint
{
private const string DefaultProtocols = "Http1AndHttp2";
/// <summary>
/// The URL associated with the endpoint.
/// </summary>
public string Url { get; set; } = string.Empty;
/// <summary>
/// The protocols associated with the endpoint. Defaults to "Http1AndHttp2" if not specified.
/// </summary>
public string Protocols { get; set; } = DefaultProtocols;
/// <summary>
/// Initializes a new instance of the <see cref="Endpoint"/> class.
/// </summary>
public Endpoint()
{
}
public class KestrelLimitsOptions
{
public long MaxRequestBodySize { get; set; }
}
}
}
}