diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-09-01 15:24:39 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-09-01 15:24:39 -0400 |
| commit | 9d784823580b3f9a14a3e4669903babdb2ee57f4 (patch) | |
| tree | 9f70130ab248962643d7fcf758d9c8b38b97b3de /MediaBrowser.Api/Library/LibraryService.cs | |
| parent | dd9404ebc6e2e03bb4f0135e48a59211252615d9 (diff) | |
fix skiasharp reference
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryService.cs')
| -rw-r--r-- | MediaBrowser.Api/Library/LibraryService.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs index 44cc60b50..6152ea20b 100644 --- a/MediaBrowser.Api/Library/LibraryService.cs +++ b/MediaBrowser.Api/Library/LibraryService.cs @@ -518,9 +518,18 @@ namespace MediaBrowser.Api.Library LogDownload(item, user, auth); } + var path = item.Path; + + // 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)) + { + headers["Content-Disposition"] = "attachment; filename=\"" + filename + "\""; + } + return ResultFactory.GetStaticFileResult(Request, new StaticFileResultOptions { - Path = item.Path, + Path = path, ResponseHeaders = headers }); } |
