mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 20:24:44 +02:00
Fix missed adjustments on http parameters
This commit is contained in:
parent
c4839708ce
commit
11e6430d42
@ -26,12 +26,11 @@ class DaemonFileRepository extends DaemonRepository
|
|||||||
Assert::isInstanceOf($this->server, Server::class);
|
Assert::isInstanceOf($this->server, Server::class);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$response = $this->getHttpClient()->get(
|
$response = $this->getHttpClient()
|
||||||
sprintf('/api/servers/%s/files/contents', $this->server->uuid),
|
->withQueryParameters(['file' => $path])
|
||||||
[
|
->get(
|
||||||
'query' => ['file' => $path],
|
sprintf('/api/servers/%s/files/contents', $this->server->uuid)
|
||||||
]
|
);
|
||||||
);
|
|
||||||
} catch (ClientException|TransferException $exception) {
|
} catch (ClientException|TransferException $exception) {
|
||||||
throw new DaemonConnectionException($exception);
|
throw new DaemonConnectionException($exception);
|
||||||
}
|
}
|
||||||
@ -55,13 +54,12 @@ class DaemonFileRepository extends DaemonRepository
|
|||||||
Assert::isInstanceOf($this->server, Server::class);
|
Assert::isInstanceOf($this->server, Server::class);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return $this->getHttpClient()->post(
|
return $this->getHttpClient()
|
||||||
sprintf('/api/servers/%s/files/write', $this->server->uuid),
|
->withQueryParameters(['file' => $path])
|
||||||
[
|
->withBody($content)
|
||||||
'query' => ['file' => $path],
|
->post(
|
||||||
'body' => $content,
|
sprintf('/api/servers/%s/files/write', $this->server->uuid)
|
||||||
]
|
);
|
||||||
);
|
|
||||||
} catch (TransferException $exception) {
|
} catch (TransferException $exception) {
|
||||||
throw new DaemonConnectionException($exception);
|
throw new DaemonConnectionException($exception);
|
||||||
}
|
}
|
||||||
@ -79,9 +77,7 @@ class DaemonFileRepository extends DaemonRepository
|
|||||||
try {
|
try {
|
||||||
$response = $this->getHttpClient()->get(
|
$response = $this->getHttpClient()->get(
|
||||||
sprintf('/api/servers/%s/files/list-directory', $this->server->uuid),
|
sprintf('/api/servers/%s/files/list-directory', $this->server->uuid),
|
||||||
[
|
['directory' => $path]
|
||||||
'query' => ['directory' => $path],
|
|
||||||
]
|
|
||||||
);
|
);
|
||||||
} catch (TransferException $exception) {
|
} catch (TransferException $exception) {
|
||||||
throw new DaemonConnectionException($exception);
|
throw new DaemonConnectionException($exception);
|
||||||
@ -125,10 +121,8 @@ class DaemonFileRepository extends DaemonRepository
|
|||||||
return $this->getHttpClient()->put(
|
return $this->getHttpClient()->put(
|
||||||
sprintf('/api/servers/%s/files/rename', $this->server->uuid),
|
sprintf('/api/servers/%s/files/rename', $this->server->uuid),
|
||||||
[
|
[
|
||||||
'json' => [
|
'root' => $root ?? '/',
|
||||||
'root' => $root ?? '/',
|
'files' => $files,
|
||||||
'files' => $files,
|
|
||||||
],
|
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
} catch (TransferException $exception) {
|
} catch (TransferException $exception) {
|
||||||
@ -275,9 +269,7 @@ class DaemonFileRepository extends DaemonRepository
|
|||||||
try {
|
try {
|
||||||
return $this->getHttpClient()->post(
|
return $this->getHttpClient()->post(
|
||||||
sprintf('/api/servers/%s/files/pull', $this->server->uuid),
|
sprintf('/api/servers/%s/files/pull', $this->server->uuid),
|
||||||
[
|
array_filter($attributes, fn ($value) => !is_null($value))
|
||||||
array_filter($attributes, fn ($value) => !is_null($value)),
|
|
||||||
]
|
|
||||||
);
|
);
|
||||||
} catch (TransferException $exception) {
|
} catch (TransferException $exception) {
|
||||||
throw new DaemonConnectionException($exception);
|
throw new DaemonConnectionException($exception);
|
||||||
|
@ -147,7 +147,7 @@ class DaemonServerRepository extends DaemonRepository
|
|||||||
try {
|
try {
|
||||||
$this->getHttpClient()
|
$this->getHttpClient()
|
||||||
->post(sprintf('/api/servers/%s/ws/deny', $this->server->uuid), [
|
->post(sprintf('/api/servers/%s/ws/deny', $this->server->uuid), [
|
||||||
'json' => ['jtis' => $jtis],
|
'jtis' => $jtis,
|
||||||
]);
|
]);
|
||||||
} catch (TransferException $exception) {
|
} catch (TransferException $exception) {
|
||||||
throw new DaemonConnectionException($exception);
|
throw new DaemonConnectionException($exception);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user