fix file timezone and isDownload for local files temp urls (#837)

closes #834
This commit is contained in:
Andrew Camilleri
2019-05-15 13:02:03 +00:00
committed by Nicolas Dorier
parent 7aa6d1a8d7
commit 461462eafc
5 changed files with 19 additions and 6 deletions

View File

@@ -43,7 +43,14 @@ namespace BTCPayServer.Storage
{
ServeUnknownFileTypes = true,
RequestPath = new PathString($"/{FileSystemFileProviderService.LocalStorageDirectoryName}"),
FileProvider = new PhysicalFileProvider(dirInfo.FullName)
FileProvider = new PhysicalFileProvider(dirInfo.FullName),
OnPrepareResponse = context =>
{
if (context.Context.Request.Query.ContainsKey("download"))
{
context.Context.Response.Headers["Content-Disposition"] = "attachment";
}
}
});
}
}