소스 검색

feat: Improve Google Drive file upload with correct headers

Taylor Wilsdon (aider) 4 달 전
부모
커밋
29efee8ede
2개의 변경된 파일3개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 4
      src/lib/components/chat/Chat.svelte
  2. 2 1
      src/lib/utils/google-drive-picker.ts

+ 1 - 4
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';

+ 2 - 1
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);