diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-03-08 11:21:51 +0100 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-03-08 11:21:51 +0100 |
commit | 58f57fd13fa4e1dc80724e0e51378ff4e185d098 (patch) | |
tree | 4642ecbb3ed4e0175e082de0d3a0f79871b81459 /apps | |
parent | b6691b35c7be946f038a6c8c6d221e64c60788f4 (diff) | |
download | nextcloud-server-58f57fd13fa4e1dc80724e0e51378ff4e185d098.tar.gz nextcloud-server-58f57fd13fa4e1dc80724e0e51378ff4e185d098.zip |
fix(settings): Adjust order of parameters for `runRequest`
Fixing invalid request to host `HEAD`.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings/lib/SetupChecks/CheckServerResponseTrait.php | 8 | ||||
-rw-r--r-- | apps/settings/lib/SetupChecks/WellKnownUrls.php | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/apps/settings/lib/SetupChecks/CheckServerResponseTrait.php b/apps/settings/lib/SetupChecks/CheckServerResponseTrait.php index aafade1526a..e78ec602209 100644 --- a/apps/settings/lib/SetupChecks/CheckServerResponseTrait.php +++ b/apps/settings/lib/SetupChecks/CheckServerResponseTrait.php @@ -74,8 +74,8 @@ trait CheckServerResponseTrait { /** * Run a HTTP request to check header - * @param string $url The relative URL to check * @param string $method The HTTP method to use + * @param string $url The relative URL to check * @param array{ignoreSSL?: bool, httpErrors?: bool, options?: array} $options Additional options, like * [ * // Ignore invalid SSL certificates (e.g. self signed) @@ -86,7 +86,7 @@ trait CheckServerResponseTrait { * * @return Generator<int, IResponse> */ - protected function runRequest(string $url, string $method, array $options = []): Generator { + protected function runRequest(string $method, string $url, array $options = []): Generator { $options = array_merge(['ignoreSSL' => true, 'httpErrors' => true], $options); $client = $this->clientService->newClient(); @@ -95,7 +95,7 @@ trait CheckServerResponseTrait { foreach ($this->getTestUrls($url) as $testURL) { try { - yield $client->request($testURL, $method, $requestOptions); + yield $client->request($method, $testURL, $requestOptions); } catch (\Throwable $e) { $this->logger->debug('Can not connect to local server for running setup checks', ['exception' => $e, 'url' => $testURL]); } @@ -110,7 +110,7 @@ trait CheckServerResponseTrait { * @return Generator<int, IResponse> */ protected function runHEAD(string $url, bool $ignoreSSL = true, bool $httpErrors = true): Generator { - return $this->runRequest($url, 'HEAD', ['ignoreSSL' => $ignoreSSL, 'httpErrors' => $httpErrors]); + return $this->runRequest('HEAD', $url, ['ignoreSSL' => $ignoreSSL, 'httpErrors' => $httpErrors]); } protected function getRequestOptions(bool $ignoreSSL, bool $httpErrors): array { diff --git a/apps/settings/lib/SetupChecks/WellKnownUrls.php b/apps/settings/lib/SetupChecks/WellKnownUrls.php index 933f82b614f..f30bf217690 100644 --- a/apps/settings/lib/SetupChecks/WellKnownUrls.php +++ b/apps/settings/lib/SetupChecks/WellKnownUrls.php @@ -70,7 +70,7 @@ class WellKnownUrls implements ISetupCheck { foreach ($urls as [$verb,$url,$validStatuses,$checkCustomHeader]) { $works = null; - foreach ($this->runRequest($url, $verb, ['httpErrors' => false, 'options' => ['allow_redirects' => ['track_redirects' => true]]]) as $response) { + foreach ($this->runRequest($verb, $url, ['httpErrors' => false, 'options' => ['allow_redirects' => ['track_redirects' => true]]]) as $response) { // Check that the response status matches $works = in_array($response->getStatusCode(), $validStatuses); // and (if needed) the custom Nextcloud header is set |