Commit 5e732b7a authored by Mahmoud Aglan's avatar Mahmoud Aglan

fix: add missing apikey header to SupabaseStorage requests

Kong gateway requires the apikey header alongside Authorization.
Without it, storage uploads fail with "No API key found in request".
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 0183a9af
...@@ -32,6 +32,7 @@ class SupabaseStorage ...@@ -32,6 +32,7 @@ class SupabaseStorage
CURLOPT_POST => true, CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $fileContent, CURLOPT_POSTFIELDS => $fileContent,
CURLOPT_HTTPHEADER => [ CURLOPT_HTTPHEADER => [
'apikey: ' . $this->serviceKey,
'Authorization: Bearer ' . $this->serviceKey, 'Authorization: Bearer ' . $this->serviceKey,
'Content-Type: ' . $mimeType, 'Content-Type: ' . $mimeType,
'x-upsert: true', 'x-upsert: true',
...@@ -61,6 +62,7 @@ class SupabaseStorage ...@@ -61,6 +62,7 @@ class SupabaseStorage
CURLOPT_RETURNTRANSFER => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE', CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => [ CURLOPT_HTTPHEADER => [
'apikey: ' . $this->serviceKey,
'Authorization: Bearer ' . $this->serviceKey, 'Authorization: Bearer ' . $this->serviceKey,
], ],
CURLOPT_TIMEOUT => 30, CURLOPT_TIMEOUT => 30,
...@@ -89,6 +91,7 @@ class SupabaseStorage ...@@ -89,6 +91,7 @@ class SupabaseStorage
CURLOPT_POST => true, CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode(['expiresIn' => $expiresIn]), CURLOPT_POSTFIELDS => json_encode(['expiresIn' => $expiresIn]),
CURLOPT_HTTPHEADER => [ CURLOPT_HTTPHEADER => [
'apikey: ' . $this->serviceKey,
'Authorization: Bearer ' . $this->serviceKey, 'Authorization: Bearer ' . $this->serviceKey,
'Content-Type: application/json', 'Content-Type: application/json',
], ],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment