From 3b68fa204b541997e6b6d7ab602ecd9478a0c6a9 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 17 Dec 2024 18:00:31 -0600 Subject: bump request limits to insanely high values --- src/slskd/Relay/API/Controllers/RelayController.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/slskd/Relay/API/Controllers/RelayController.cs b/src/slskd/Relay/API/Controllers/RelayController.cs index c0f65298..583225fd 100644 --- a/src/slskd/Relay/API/Controllers/RelayController.cs +++ b/src/slskd/Relay/API/Controllers/RelayController.cs @@ -42,7 +42,8 @@ namespace slskd.Relay [ApiController] public class RelayController : ControllerBase { - private const long TEN_GIGABYTES = 10L * 1024L * 1024L * 1024L; + private const long ONE_GIBIBYTE = 1L * 1024L * 1024L * 1024L; // 1073741824 + private const long ONE_TEBIBYTE = 1024L * ONE_GIBIBYTE; // 1099511627776 /// /// Initializes a new instance of the class. @@ -157,8 +158,8 @@ namespace slskd.Relay /// The unique identifier for the request. /// [HttpPost("controller/files/{token}")] - [RequestSizeLimit(TEN_GIGABYTES)] - [RequestFormLimits(MultipartBodyLengthLimit = TEN_GIGABYTES)] + [RequestSizeLimit(10L * ONE_TEBIBYTE)] + [RequestFormLimits(MultipartBodyLengthLimit = 10L * ONE_TEBIBYTE)] [DisableFormValueModelBinding] [Authorize(Policy = AuthPolicy.ApiKeyOnly, Roles = AuthRole.ReadWriteOrAdministrator)] public async Task UploadFile(string token) @@ -255,8 +256,8 @@ namespace slskd.Relay /// The unique identifier for the request. /// [HttpPost("controller/shares/{token}")] - [RequestSizeLimit(TEN_GIGABYTES)] - [RequestFormLimits(MultipartBodyLengthLimit = TEN_GIGABYTES)] + [RequestSizeLimit(ONE_TEBIBYTE)] + [RequestFormLimits(MultipartBodyLengthLimit = ONE_TEBIBYTE)] [Authorize(Policy = AuthPolicy.ApiKeyOnly, Roles = AuthRole.ReadWriteOrAdministrator)] public async Task UploadShares(string token) { -- cgit v1.2.3