Render html server side for proper metadata tagging

This commit is contained in:
Kieran
2022-07-09 23:19:41 +01:00
parent cec5a01d5d
commit 0249b1cedf
5 changed files with 137 additions and 5 deletions

View File

@@ -44,7 +44,7 @@ public class DownloadController : Controller
var voidFile = await SetupDownload(gid);
if (voidFile == default) return;
var egressReq = new EgressRequest(gid, GetRanges(Request, (long)voidFile!.Metadata!.Size));
var egressReq = new EgressRequest(gid, GetRanges(Request, (long) voidFile!.Metadata!.Size));
if (egressReq.Ranges.Count() > 1)
{
_logger.LogWarning("Multi-range request not supported!");
@@ -56,10 +56,10 @@ public class DownloadController : Controller
}
else if (egressReq.Ranges.Count() == 1)
{
Response.StatusCode = (int)HttpStatusCode.PartialContent;
Response.StatusCode = (int) HttpStatusCode.PartialContent;
if (egressReq.Ranges.Sum(a => a.Size) == 0)
{
Response.StatusCode = (int)HttpStatusCode.RequestedRangeNotSatisfiable;
Response.StatusCode = (int) HttpStatusCode.RequestedRangeNotSatisfiable;
return;
}
}
@@ -95,7 +95,7 @@ public class DownloadController : Controller
var orderId = Request.Headers.GetHeader("V-OrderId") ?? Request.Query["orderId"];
if (!await IsOrderPaid(orderId))
{
Response.StatusCode = (int)HttpStatusCode.PaymentRequired;
Response.StatusCode = (int) HttpStatusCode.PaymentRequired;
return default;
}
}
@@ -136,4 +136,4 @@ public class DownloadController : Controller
}
}
}
}
}