diff options
| author | JP Dillingham <jp@dillingham.me> | 2024-10-20 17:02:39 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2024-10-20 17:02:39 -0500 |
| commit | ba6257cc9ddb2fdd0f3585317f1a1708b8d90ffd (patch) | |
| tree | cffeef605f06df4b4376067045b9d772815eac50 /src/slskd/Relay/API | |
| parent | 4511741facda6c232b4748940ea0f111fa081abe (diff) | |
| parent | 54590c78f2102634d982698608784e8d3c9043e0 (diff) | |
| download | slskd-ba6257cc9ddb2fdd0f3585317f1a1708b8d90ffd.tar.gz | |
Merge remote-tracking branch 'origin/master' into scripts
Diffstat (limited to 'src/slskd/Relay/API')
| -rw-r--r-- | src/slskd/Relay/API/Controllers/RelayController.cs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/slskd/Relay/API/Controllers/RelayController.cs b/src/slskd/Relay/API/Controllers/RelayController.cs index 3d374aa8..c0f65298 100644 --- a/src/slskd/Relay/API/Controllers/RelayController.cs +++ b/src/slskd/Relay/API/Controllers/RelayController.cs @@ -42,6 +42,8 @@ namespace slskd.Relay [ApiController] public class RelayController : ControllerBase { + private const long TEN_GIGABYTES = 10L * 1024L * 1024L * 1024L; + /// <summary> /// Initializes a new instance of the <see cref="RelayController"/> class. /// </summary> @@ -105,7 +107,7 @@ namespace slskd.Relay /// <returns></returns> [HttpGet("controller/downloads/{token}")] [Authorize(Policy = AuthPolicy.ApiKeyOnly, Roles = AuthRole.Any)] - public IActionResult DownloadFile([FromRoute]string token) + public IActionResult DownloadFile([FromRoute] string token) { if (!OptionsAtStartup.Relay.Enabled || !new[] { RelayMode.Controller, RelayMode.Debug }.Contains(OperationMode)) { @@ -155,8 +157,8 @@ namespace slskd.Relay /// <param name="token">The unique identifier for the request.</param> /// <returns></returns> [HttpPost("controller/files/{token}")] - [RequestSizeLimit(10L * 1024L * 1024L * 1024L)] - [RequestFormLimits(MultipartBodyLengthLimit = 10L * 1024L * 1024L * 1024L)] + [RequestSizeLimit(TEN_GIGABYTES)] + [RequestFormLimits(MultipartBodyLengthLimit = TEN_GIGABYTES)] [DisableFormValueModelBinding] [Authorize(Policy = AuthPolicy.ApiKeyOnly, Roles = AuthRole.ReadWriteOrAdministrator)] public async Task<IActionResult> UploadFile(string token) @@ -253,6 +255,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)] [Authorize(Policy = AuthPolicy.ApiKeyOnly, Roles = AuthRole.ReadWriteOrAdministrator)] public async Task<IActionResult> UploadShares(string token) { |
