From 5f51a2fe3461e1f88e75b0b6959719d25f657ef3 Mon Sep 17 00:00:00 2001 From: Shuxia Ning <NingShuxia0927@outlook.com> Date: 星期二, 07 一月 2025 17:34:27 +0800 Subject: [PATCH] 曲线模块修改 --- WebApi/HStation.WebApi.TransferFile.Core/Startup.cs | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/WebApi/HStation.WebApi.TransferFile.Core/Startup.cs b/WebApi/HStation.WebApi.TransferFile.Core/Startup.cs index 70deda0..82c51b0 100644 --- a/WebApi/HStation.WebApi.TransferFile.Core/Startup.cs +++ b/WebApi/HStation.WebApi.TransferFile.Core/Startup.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.Extensions.DependencyInjection; @@ -30,11 +31,23 @@ services.Configure<KestrelServerOptions>(options => { - options.Limits.MaxRequestBodySize = int.MaxValue; + options.Limits.MaxRequestBodySize = int.MaxValue;//涔嬪墠鐨� + options.Limits.MaxRequestBufferSize = int.MaxValue; + options.Limits.MaxResponseBufferSize = int.MaxValue; + }); services.Configure<IISServerOptions>(options => { - options.MaxRequestBodySize = int.MaxValue; + options.MaxRequestBodySize = int.MaxValue;//涔嬪墠鐨� + options.MaxRequestBodyBufferSize = int.MaxValue; + }); + //瑙e喅Multipart body length limit 134217728 exceeded + services.Configure<FormOptions>(x => + { + x.ValueLengthLimit = int.MaxValue; + x.MultipartBodyLengthLimit = int.MaxValue; // In case of multipart + x.MultipartBoundaryLengthLimit = int.MaxValue; + x.BufferBodyLengthLimit = int.MaxValue; }); // services.AddJwt<JwtHandler>(enableGlobalAuthorize: true); -- Gitblit v1.9.3