Handle kindle browser download filename can only contain ASCII characters (#3266)

This commit is contained in:
Ozzie Isaacs
2025-01-06 17:36:17 +01:00
parent 4512ab4524
commit 4ccc2c0aec
2 changed files with 14 additions and 6 deletions

View File

@@ -1242,7 +1242,12 @@ def serve_book(book_id, book_format, anyname):
@login_required_if_no_ano
@download_required
def download_link(book_id, book_format, anyname):
client = "kobo" if "Kobo" in request.headers.get('User-Agent') else ""
if "kindle" in request.headers.get('User-Agent').lower():
client = "kindle"
elif "Kobo" in request.headers.get('User-Agent').lower():
client = "kobo"
else:
client = ""
return get_download_link(book_id, book_format, client)