Fix out of memory of 2gb+ (max 4gb) error introduced by #14657 SVG xss security fix (#17421)

Co-authored-by: Andy Butland <abutland73@gmail.com>
This commit is contained in:
TimBoonstra
2025-01-31 14:46:56 +01:00
committed by GitHub
parent 1a18d6c035
commit 17615f966b

View File

@@ -788,8 +788,7 @@ public class MediaController : ContentControllerBase
continue;
}
using var stream = new MemoryStream();
await formFile.CopyToAsync(stream);
await using var stream = formFile.OpenReadStream();
if (_fileStreamSecurityValidator != null && _fileStreamSecurityValidator.IsConsideredSafe(stream) == false)
{
tempFiles.Notifications.Add(new BackOfficeNotification(