From a38319da5827bb4e7ca4453c980ce7f8a73a8ba3 Mon Sep 17 00:00:00 2001 From: OtavioStasiak Date: Wed, 11 Feb 2026 15:14:21 -0300 Subject: [PATCH] fix: add headers to download the PDF --- app/lib/methods/helpers/fileDownload.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/lib/methods/helpers/fileDownload.ts b/app/lib/methods/helpers/fileDownload.ts index 2c6f32ecd17..554ae0fbc8d 100644 --- a/app/lib/methods/helpers/fileDownload.ts +++ b/app/lib/methods/helpers/fileDownload.ts @@ -7,6 +7,7 @@ import i18n from '../../../i18n'; import EventEmitter from './events'; import { Encryption } from '../../encryption'; import { sanitizeFileName } from '../handleMediaDownload'; +import { headers } from './fetch'; export const getLocalFilePathFromFile = (localPath: string, attachment: IAttachment): string => `${localPath}${attachment.title}`; @@ -18,7 +19,7 @@ export const fileDownload = async (url: string, attachment?: IAttachment, fileNa if (attachment?.title) { path = `${path}${sanitizeFileName(attachment.title)}`; } - const file = await FileSystem.downloadAsync(url, path); + const file = await FileSystem.downloadAsync(url, path, { headers: headers as Record }); return file.uri; };