diff --git a/ProjectLighthouse/Controllers/ResourcesController.cs b/ProjectLighthouse/Controllers/ResourcesController.cs index d1a438db..adb7734b 100644 --- a/ProjectLighthouse/Controllers/ResourcesController.cs +++ b/ProjectLighthouse/Controllers/ResourcesController.cs @@ -51,7 +51,6 @@ namespace LBPUnion.ProjectLighthouse.Controllers // TODO: check if this is a valid hash [HttpPost("upload/{hash}")] - [AllowSynchronousIo] public async Task UploadResource(string hash) { string assetsDirectory = FileHelper.ResourcePath; diff --git a/ProjectLighthouse/Helpers/AllowSynchronousIOAttribute.cs b/ProjectLighthouse/Helpers/AllowSynchronousIOAttribute.cs deleted file mode 100644 index 1054f1a7..00000000 --- a/ProjectLighthouse/Helpers/AllowSynchronousIOAttribute.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Mvc.Filters; - -namespace LBPUnion.ProjectLighthouse.Helpers -{ - // Yoinked from https://stackoverflow.com/a/68530667 - // Thanks to T-moty! - /// - /// Allows synchronous stream operations for this request. - /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] - public class AllowSynchronousIoAttribute : ActionFilterAttribute - { - public override void OnResultExecuting(ResultExecutingContext context) - { - IHttpBodyControlFeature syncIoFeature = context.HttpContext.Features.Get(); - if (syncIoFeature != null) syncIoFeature.AllowSynchronousIO = true; - } - } -} \ No newline at end of file