From 9de0963595896c8b39fd6179895ec85805210cc7 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Mon, 26 May 2025 16:26:53 +0700 Subject: [PATCH] Chevereto upload pass key in body --- nexus/Attachment/Drivers/Chevereto.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nexus/Attachment/Drivers/Chevereto.php b/nexus/Attachment/Drivers/Chevereto.php index d9ff1798..4b9c5920 100644 --- a/nexus/Attachment/Drivers/Chevereto.php +++ b/nexus/Attachment/Drivers/Chevereto.php @@ -10,8 +10,6 @@ class Chevereto extends Storage { { $api = get_setting("image_hosting_chevereto.upload_api_endpoint"); $token = get_setting("image_hosting_chevereto.upload_token"); - $apiQueryString = parse_url($api, PHP_URL_QUERY); - $api .= (!empty($apiQueryString) ? "&" : "?") . "key=$token"; $logPrefix = "filepath: $filepath, api: $api, token: $token"; $httpClient = new \GuzzleHttp\Client(); $response = $httpClient->request('POST', $api, [ @@ -22,6 +20,10 @@ class Chevereto extends Storage { [ 'name' => 'source', 'contents' => Psr7\Utils::tryFopen($filepath, 'r') + ], + [ + 'name' => 'key', + 'contents' => $token ] ] ]);