| | |
| | | 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; |
| | |
| | | |
| | | 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; |
| | | }); |
| | | //解决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); |