mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-03 10:38:40 +00:00
Remove AllowSynchronousIOAttribute
This commit is contained in:
parent
249b1d582c
commit
2f817f9aa8
2 changed files with 0 additions and 22 deletions
|
@ -51,7 +51,6 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
|
||||
// TODO: check if this is a valid hash
|
||||
[HttpPost("upload/{hash}")]
|
||||
[AllowSynchronousIo]
|
||||
public async Task<IActionResult> UploadResource(string hash)
|
||||
{
|
||||
string assetsDirectory = FileHelper.ResourcePath;
|
||||
|
|
|
@ -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!
|
||||
/// <summary>
|
||||
/// Allows synchronous stream operations for this request.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
|
||||
public class AllowSynchronousIoAttribute : ActionFilterAttribute
|
||||
{
|
||||
public override void OnResultExecuting(ResultExecutingContext context)
|
||||
{
|
||||
IHttpBodyControlFeature syncIoFeature = context.HttpContext.Features.Get<IHttpBodyControlFeature>();
|
||||
if (syncIoFeature != null) syncIoFeature.AllowSynchronousIO = true;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue