aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Library/LibraryService.cs
diff options
context:
space:
mode:
authorSteven Tang <xosdy.t@gmail.com>2020-02-29 12:11:27 +0800
committerSteven Tang <xosdy.t@gmail.com>2020-02-29 12:11:27 +0800
commit2e856ad9fe16c87269501fec6918e5305ed31d93 (patch)
tree17f241d5dbe68869bc4bc07e0b4eb0b1f4c4321c /MediaBrowser.Api/Library/LibraryService.cs
parent6261e4e7f67457a57c58e17cdd10e1f5b867261a (diff)
Fix download file with non-ASCII filename
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryService.cs')
-rw-r--r--MediaBrowser.Api/Library/LibraryService.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs
index 3d1e4a363..15284958d 100644
--- a/MediaBrowser.Api/Library/LibraryService.cs
+++ b/MediaBrowser.Api/Library/LibraryService.cs
@@ -815,7 +815,7 @@ namespace MediaBrowser.Api.Library
if (!string.IsNullOrWhiteSpace(filename))
{
// Kestrel doesn't support non-ASCII characters in headers
- if (Regex.IsMatch(filename, "[^[:ascii:]]"))
+ if (Regex.IsMatch(filename, @"[^\p{IsBasicLatin}]"))
{
// Manually encoding non-ASCII characters, following https://tools.ietf.org/html/rfc5987#section-3.2.2
headers[HeaderNames.ContentDisposition] = "attachment; filename*=UTF-8''" + WebUtility.UrlEncode(filename);