mirror of
https://git.v0l.io/Kieran/void.cat.git
synced 2025-03-29 16:11:43 +01:00
Formatting
This commit is contained in:
parent
ff9099d33f
commit
7edac4f36b
@ -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";
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user