Skip to content

Commit b5fe198

Browse files
authored
Merge pull request #144 from utopia-php/fix-headers
Fix duplicate header issue for Swoole 6.1.6 compatibility
2 parents 0d6e777 + 41356ca commit b5fe198

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/Migration/Destinations/Appwrite.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,8 +1130,6 @@ public function importFile(File $file): File
11301130
"/storage/buckets/{$bucketId}/files",
11311131
[
11321132
'content-type' => 'multipart/form-data',
1133-
'X-Appwrite-Project' => $this->project,
1134-
'X-Appwrite-Key' => $this->key,
11351133
],
11361134
[
11371135
'bucketId' => $bucketId,
@@ -1153,8 +1151,6 @@ public function importFile(File $file): File
11531151
[
11541152
'content-type' => 'multipart/form-data',
11551153
'content-range' => 'bytes ' . ($file->getStart()) . '-' . ($file->getEnd() == ($file->getSize() - 1) ? $file->getSize() : $file->getEnd()) . '/' . $file->getSize(),
1156-
'x-appwrite-project' => $this->project,
1157-
'x-appwrite-key' => $this->key,
11581154
],
11591155
[
11601156
'bucketId' => $bucketId,

src/Migration/Sources/Appwrite.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ public function __construct(
8787
$this->storage = new Storage($this->client);
8888
$this->functions = new Functions($this->client);
8989

90-
$this->headers['X-Appwrite-Project'] = $this->project;
91-
$this->headers['X-Appwrite-Key'] = $this->key;
90+
$this->headers['x-appwrite-project'] = $this->project;
91+
$this->headers['x-appwrite-key'] = $this->key;
9292

9393
switch ($this->source) {
9494
case static::SOURCE_API:
@@ -184,8 +184,8 @@ public function report(array $resources = [], array $resourceIds = []): array
184184
'GET',
185185
'/health/version',
186186
[
187-
'X-Appwrite-Key' => '',
188-
'X-Appwrite-Project' => '',
187+
'x-appwrite-key' => '',
188+
'x-appwrite-project' => '',
189189
]
190190
)['version'];
191191
} catch (\Throwable $e) {

0 commit comments

Comments
 (0)