mirror of
https://git.v0l.io/Kieran/void.cat.git
synced 2025-11-15 21:26:24 +01:00
Redirect from file store for direct serve
This commit is contained in:
@@ -75,6 +75,15 @@ public class DownloadController : Controller
|
||||
Response.ContentLength = range.Size;
|
||||
}
|
||||
|
||||
var preResult = await _storage.StartEgress(egressReq);
|
||||
if (preResult.Redirect != null)
|
||||
{
|
||||
Response.StatusCode = (int)HttpStatusCode.Redirect;
|
||||
Response.Headers.Location = preResult.Redirect.ToString();
|
||||
Response.ContentLength = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
var cts = HttpContext.RequestAborted;
|
||||
await Response.StartAsync(cts);
|
||||
await _storage.Egress(egressReq, Response.Body, cts);
|
||||
|
||||
Reference in New Issue
Block a user