mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-23 19:37:23 +08:00
Chevereto upload pass key in body
This commit is contained in:
@@ -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
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user