Compute file server etag with MD5 and always include ModifiedOn
This commit is contained in:
@ -137,15 +137,15 @@ namespace Oqtane.Pages
|
||||
string downloadName = file.Name;
|
||||
string filepath = _files.GetFilePath(file);
|
||||
|
||||
var etagInput = $"{file.ModifiedOn.Ticks}:{file.Size}";
|
||||
|
||||
if (Request.QueryString.HasValue)
|
||||
{
|
||||
etag = Utilities.GenerateSimpleHash(Request.QueryString.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
etag = Convert.ToString(file.ModifiedOn.Ticks ^ file.Size, 16);
|
||||
etagInput += $":{Request.QueryString.Value}";
|
||||
}
|
||||
|
||||
etag = Utilities.GenerateHashMD5(etagInput);
|
||||
|
||||
var header = "";
|
||||
if (HttpContext.Request.Headers.TryGetValue(HeaderNames.IfNoneMatch, out var ifNoneMatch))
|
||||
{
|
||||
|
Reference in New Issue
Block a user