feat: Improve Google Drive file upload with correct headers

This commit is contained in:
Taylor Wilsdon (aider) 2024-12-15 18:57:59 -05:00
parent 7d55f9bc2e
commit 29efee8ede
2 changed files with 3 additions and 5 deletions

View File

@ -362,10 +362,7 @@
try { try {
files = [...files, fileItem]; files = [...files, fileItem];
// Pass both URL and headers to processWeb const res = await processWeb(localStorage.token, '', fileData.url, fileData.headers);
const res = await processWeb(localStorage.token, '', fileData.url, {
headers: fileData.headers
});
if (res) { if (res) {
fileItem.status = 'uploaded'; fileItem.status = 'uploaded';

View File

@ -126,7 +126,8 @@ export const createPicker = () => {
name: fileName, name: fileName,
url: downloadUrl, url: downloadUrl,
headers: { headers: {
'Authorization': `Bearer ${oauthToken}` 'Authorization': `Bearer ${oauthToken}`,
'Content-Type': 'application/json'
} }
}; };
console.log('Resolving picker with:', result); console.log('Resolving picker with:', result);