diff options
| author | JP Dillingham <jp@dillingham.me> | 2024-12-17 18:06:14 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-17 18:06:14 -0600 |
| commit | cfcdeff46861cdd11a5cbafe533ce08bda584566 (patch) | |
| tree | a6f894ece0df5bfd81e484b1e71cf0e051f6cd1f /src/slskd | |
| parent | 10393094e835755d3dacf5255b3598b5868bbc49 (diff) | |
| parent | 13179b8b6206ae25d79f2cd09d1b635807fb44fd (diff) | |
| download | slskd-cfcdeff46861cdd11a5cbafe533ce08bda584566.tar.gz | |
Merge pull request #1261 from slskd/multipart
Bump Relay multipart request limits to insanely high values
Diffstat (limited to 'src/slskd')
| -rw-r--r-- | src/slskd/Relay/API/Controllers/RelayController.cs | 11 |
1 files changed, 6 insertions, 5 deletions
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 /// <summary> /// Initializes a new instance of the <see cref="RelayController"/> class. @@ -157,8 +158,8 @@ namespace slskd.Relay /// <param name="token">The unique identifier for the request.</param> /// <returns></returns> [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<IActionResult> UploadFile(string token) @@ -255,8 +256,8 @@ namespace slskd.Relay /// <param name="token">The unique identifier for the request.</param> /// <returns></returns> [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<IActionResult> UploadShares(string token) { |
