From 29efee8ede042ebec71934bced217d34cfbc1c09 Mon Sep 17 00:00:00 2001 From: "Taylor Wilsdon (aider)" Date: Sun, 15 Dec 2024 18:57:59 -0500 Subject: [PATCH] feat: Improve Google Drive file upload with correct headers --- src/lib/components/chat/Chat.svelte | 5 +---- src/lib/utils/google-drive-picker.ts | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index e753a999b..431fd30b6 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -362,10 +362,7 @@ try { files = [...files, fileItem]; - // Pass both URL and headers to processWeb - const res = await processWeb(localStorage.token, '', fileData.url, { - headers: fileData.headers - }); + const res = await processWeb(localStorage.token, '', fileData.url, fileData.headers); if (res) { fileItem.status = 'uploaded'; diff --git a/src/lib/utils/google-drive-picker.ts b/src/lib/utils/google-drive-picker.ts index 7418459e3..1c6bef977 100644 --- a/src/lib/utils/google-drive-picker.ts +++ b/src/lib/utils/google-drive-picker.ts @@ -126,7 +126,8 @@ export const createPicker = () => { name: fileName, url: downloadUrl, headers: { - 'Authorization': `Bearer ${oauthToken}` + 'Authorization': `Bearer ${oauthToken}`, + 'Content-Type': 'application/json' } }; console.log('Resolving picker with:', result);