aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-07-23 02:12:16 -0400
committerGitHub <noreply@github.com>2017-07-23 02:12:16 -0400
commit5ec9d4e9fe4b3e5109ca1abf6c1ffdb87fd2d4dd (patch)
treee49cc827583b6dffeabb142af5fae889b1a09581 /Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
parente99bc61d53f393dc475e265e3b5bc8c19b186594 (diff)
parent0d1b5ad733e6f1bbf6d730e723969495dda99016 (diff)
Merge pull request #2767 from MediaBrowser/beta
Beta
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/HttpResultFactory.cs')
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpResultFactory.cs9
1 files changed, 9 insertions, 0 deletions
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<string, string>(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);
}