Skip to content

Commit

Permalink
fix bug 69459
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelbannov committed Aug 1, 2024
1 parent 887ec09 commit 9f8b7f8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions products/ASC.Files/Core/HttpHandlers/FileHandler.ashx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,12 @@ private async Task DownloadFile<T>(HttpContext context, T id, bool forView)
}

if (!await fileSecurity.CanDownloadAsync(file))
{
context.Response.StatusCode = (int)HttpStatusCode.Forbidden;
return;
{
if (!(fileUtility.CanImageView(file.Title) || fileUtility.CanMediaView(file.Title)))
{
context.Response.StatusCode = (int)HttpStatusCode.Forbidden;
return;
}
}

if (!string.IsNullOrEmpty(file.Error))
Expand Down Expand Up @@ -970,7 +973,7 @@ private async Task ThumbnailFile(HttpContext context, bool force)
}

private async Task ThumbnailFile(HttpContext context, int id, bool force)
{
{
IFileDao<int> fileDao = null;
File<int> file = null;
try
Expand Down

0 comments on commit 9f8b7f8

Please sign in to comment.