aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2024-12-17 18:00:31 -0600
committerJP Dillingham <jp@dillingham.me>2024-12-17 18:00:31 -0600
commit3b68fa204b541997e6b6d7ab602ecd9478a0c6a9 (patch)
tree279a03cf9bc2fd8c4ecc7ccf9688d3f191a5c316 /src
parentac4518147eebd921edb7cf465013eabc37fae4e7 (diff)
downloadslskd-3b68fa204b541997e6b6d7ab602ecd9478a0c6a9.tar.gz
bump request limits to insanely high values
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Relay/API/Controllers/RelayController.cs11
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)
{