Formatting

This commit is contained in:
Kieran 2022-02-08 23:56:35 +00:00
parent ff9099d33f
commit 7edac4f36b
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 5 additions and 5 deletions

View File

@ -24,7 +24,7 @@ public class DownloadController : Controller
var gid = id.FromBase58Guid();
return SetupDownload(gid);
}
[ResponseCache(Location = ResponseCacheLocation.Any, Duration = 86400)]
[HttpGet]
[Route("{id}")]
@ -43,7 +43,7 @@ public class DownloadController : Controller
Ranges = Enumerable.Empty<RangeRequest>()
};
}
else if(egressReq.Ranges.Count() == 1)
else if (egressReq.Ranges.Count() == 1)
{
Response.StatusCode = (int)HttpStatusCode.PartialContent;
}
@ -51,7 +51,7 @@ public class DownloadController : Controller
{
Response.Headers.AcceptRanges = "bytes";
}
foreach (var range in egressReq.Ranges)
{
Response.Headers.Add("content-range", range.ToContentRange());
@ -72,7 +72,7 @@ public class DownloadController : Controller
Response.StatusCode = 404;
return null;
}
Response.Headers.XFrameOptions = "SAMEORIGIN";
Response.Headers.ContentDisposition = $"inline; filename=\"{meta?.Metadata?.Name}\"";
Response.ContentType = meta?.Metadata?.MimeType ?? "application/octet-stream";

View File

@ -112,7 +112,7 @@ public class LocalDiskFileIngressFactory : IFileStore
using var buffer = MemoryPool<byte>.Shared.Rent();
foreach (var range in ranges)
{
fileStream.Seek(range.Start ?? range.End ?? 0L,
fileStream.Seek(range.Start ?? range.End ?? 0L,
range.Start.HasValue ? SeekOrigin.Begin : SeekOrigin.End);
var readLength = 0;