fix: remover Content-Type manual do upload de avatar (deixar axios definir boundary)
This commit is contained in:
parent
7c1999733e
commit
aa06e0e3ab
@ -41,16 +41,18 @@ class AvatarService {
|
|||||||
fileName: data.file.name,
|
fileName: data.file.name,
|
||||||
fileSize: data.file.size,
|
fileSize: data.file.size,
|
||||||
fileType: data.file.type,
|
fileType: data.file.type,
|
||||||
|
token: token ? `${token.substring(0, 20)}...` : "null",
|
||||||
});
|
});
|
||||||
|
|
||||||
// Upload usando Supabase Storage API
|
// Upload usando Supabase Storage API
|
||||||
|
// Importante: NÃO definir Content-Type manualmente, deixar o axios/navegador
|
||||||
|
// definir automaticamente com o boundary correto para multipart/form-data
|
||||||
const response = await axios.post(
|
const response = await axios.post(
|
||||||
`${this.STORAGE_URL}/${this.BUCKET_NAME}/${filePath}`,
|
`${this.STORAGE_URL}/${this.BUCKET_NAME}/${filePath}`,
|
||||||
formData,
|
formData,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
"Authorization": `Bearer ${token}`,
|
"Authorization": `Bearer ${token}`,
|
||||||
"Content-Type": "multipart/form-data",
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user