From dab74b9cd182e649ef4c981204ba66309f2458d0 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 18 Jul 2017 13:34:56 -0400 Subject: 3.2.25.8 --- Emby.Server.Implementations/HttpServer/HttpResultFactory.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Emby.Server.Implementations/HttpServer/HttpResultFactory.cs') diff --git a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs index 6c37d5f7a..396bd8e88 100644 --- a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -438,6 +438,15 @@ namespace Emby.Server.Implementations.HttpServer options.CacheKey = cacheKey.GetMD5(); options.ContentFactory = () => Task.FromResult(GetFileStream(path, fileShare)); + options.ResponseHeaders = options.ResponseHeaders ?? new Dictionary(StringComparer.OrdinalIgnoreCase); + + // Quotes are valid in linux. They'll possibly cause issues here + var filename = (Path.GetFileName(path) ?? string.Empty).Replace("\"", string.Empty); + if (!string.IsNullOrWhiteSpace(filename)) + { + options.ResponseHeaders["Content-Disposition"] = "inline; filename=\"" + filename + "\""; + } + return GetStaticResult(requestContext, options); } -- cgit v1.2.3