diff options
| author | Bond-009 <bond.009@outlook.com> | 2020-03-03 14:28:48 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-03 14:28:48 +0100 |
| commit | 20ac3c36e22739402923a9fd5b2ac06f9c604c5a (patch) | |
| tree | 50ff13016a483ca696a19a23108b7bfd52113997 | |
| parent | 464039043d7a6772f130a4cc5f294d7e4945e558 (diff) | |
| parent | 2e856ad9fe16c87269501fec6918e5305ed31d93 (diff) | |
Merge pull request #2483 from xosdy/fix-download-filename
Fix download file with non-ASCII filename
| -rw-r--r-- | MediaBrowser.Api/Library/LibraryService.cs | 2 |
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); |
