From 90f10ce685e79386150ada9859cbf3fee231d756 Mon Sep 17 00:00:00 2001 From: fogelito Date: Fri, 6 Feb 2026 07:13:39 +0200 Subject: [PATCH] Use https --- src/Appwrite/Platform/Workers/Migrations.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index 7f112e2414..649f62609b 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -481,7 +481,6 @@ class Migrations extends Action array $platform, Authorization $authorization, ): void { - $credentials = $migration->getAttribute('credentials', []); $options = $migration->getAttribute('options', []); $bucketId = 'default'; // Always use platform default bucket $filename = $options['filename'] ?? 'export_' . \time(); @@ -577,8 +576,11 @@ class Migrations extends Action ]); // Generate download URL with JWT + $endpoint = System::getEnv('_APP_DOMAIN', ''); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled' ? 'https' : 'http'; + + $downloadUrl = "{$protocol}://{$endpoint}/v1/storage/buckets/{$bucketId}/files/{$fileId}/push?project={$project->getId()}&jwt={$jwt}"; - $downloadUrl = "{$credentials['endpoint']}/storage/buckets/{$bucketId}/files/{$fileId}/push?project={$project->getId()}&jwt={$jwt}"; $options['downloadUrl'] = $downloadUrl; $migration->setAttribute('options', $options); $this->updateMigrationDocument($migration, $project, $queueForRealtime);