Fixed Docker not being able to parse PDF Images (#418)

* Fixed an issue with downloading pdf files

* Bumped sentry version to latest

* Refactored PDF Page to image extraction to a private method. Bumped Sentry version in backend.

* Fixed issue with PDFs not being parsable (image) within Docker due to libgdiplus not being installed.
This commit is contained in:
Joseph Milazzo 2021-07-23 10:35:26 -05:00 committed by GitHub
parent b0df67cdda
commit 199ab7946c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 134 additions and 139 deletions

View file

@ -96,7 +96,7 @@ export class DownloadService {
*/
private getFilenameFromHeader(headers: HttpHeaders, defaultName: string) {
const tokens = (headers.get('content-disposition') || '').split(';');
let filename = tokens[1].replace('filename=', '').replace('"', '').trim();
let filename = tokens[1].replace('filename=', '').replace(/"/ig, '').trim();
if (filename.startsWith('download_') || filename.startsWith('kavita_download_')) {
const ext = filename.substring(filename.lastIndexOf('.'), filename.length);
return defaultName + ext;