[backend/drive] Allow for uploading of files larger than 128MiB if configured

This commit is contained in:
Laura Hausmann 2024-09-23 01:25:57 +02:00
parent 2bf714b8e1
commit 2a209d6de3
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -1,12 +1,13 @@
using Iceshrimp.Backend.Core.Configuration;
using Iceshrimp.Backend.Core.Middleware;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Metadata;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Options;
namespace Iceshrimp.Backend.Controllers.Shared.Attributes;
public class MaxRequestSizeIsMaxUploadSize : Attribute, IResourceFilter
public class MaxRequestSizeIsMaxUploadSize : Attribute, IFormOptionsMetadata, IResourceFilter
{
public void OnResourceExecuting(ResourceExecutingContext context)
{
@ -21,4 +22,15 @@ public class MaxRequestSizeIsMaxUploadSize : Attribute, IResourceFilter
}
public void OnResourceExecuted(ResourceExecutedContext context) { }
public bool? BufferBody => null;
public int? MemoryBufferThreshold => null;
public long? BufferBodyLengthLimit => long.MaxValue;
public int? ValueCountLimit => null;
public int? KeyLengthLimit => null;
public int? ValueLengthLimit => null;
public int? MultipartBoundaryLengthLimit => null;
public int? MultipartHeadersCountLimit => null;
public int? MultipartHeadersLengthLimit => null;
public long? MultipartBodyLengthLimit => long.MaxValue;
}