Skip to content

Commit 7484ed0

Browse files
authored
Merge pull request nextcloud#44082 from nextcloud/fix/setup-checks
fix(settings): Adjust order of parameters for `runRequest`
2 parents 94ebc97 + 58f57fd commit 7484ed0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

apps/settings/lib/SetupChecks/CheckServerResponseTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ protected function getTestUrls(string $url): array {
7474

7575
/**
7676
* Run a HTTP request to check header
77-
* @param string $url The relative URL to check
7877
* @param string $method The HTTP method to use
78+
* @param string $url The relative URL to check
7979
* @param array{ignoreSSL?: bool, httpErrors?: bool, options?: array} $options Additional options, like
8080
* [
8181
* // Ignore invalid SSL certificates (e.g. self signed)
@@ -86,7 +86,7 @@ protected function getTestUrls(string $url): array {
8686
*
8787
* @return Generator<int, IResponse>
8888
*/
89-
protected function runRequest(string $url, string $method, array $options = []): Generator {
89+
protected function runRequest(string $method, string $url, array $options = []): Generator {
9090
$options = array_merge(['ignoreSSL' => true, 'httpErrors' => true], $options);
9191

9292
$client = $this->clientService->newClient();
@@ -95,7 +95,7 @@ protected function runRequest(string $url, string $method, array $options = []):
9595

9696
foreach ($this->getTestUrls($url) as $testURL) {
9797
try {
98-
yield $client->request($testURL, $method, $requestOptions);
98+
yield $client->request($method, $testURL, $requestOptions);
9999
} catch (\Throwable $e) {
100100
$this->logger->debug('Can not connect to local server for running setup checks', ['exception' => $e, 'url' => $testURL]);
101101
}
@@ -110,7 +110,7 @@ protected function runRequest(string $url, string $method, array $options = []):
110110
* @return Generator<int, IResponse>
111111
*/
112112
protected function runHEAD(string $url, bool $ignoreSSL = true, bool $httpErrors = true): Generator {
113-
return $this->runRequest($url, 'HEAD', ['ignoreSSL' => $ignoreSSL, 'httpErrors' => $httpErrors]);
113+
return $this->runRequest('HEAD', $url, ['ignoreSSL' => $ignoreSSL, 'httpErrors' => $httpErrors]);
114114
}
115115

116116
protected function getRequestOptions(bool $ignoreSSL, bool $httpErrors): array {

apps/settings/lib/SetupChecks/WellKnownUrls.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function run(): SetupResult {
7070

7171
foreach ($urls as [$verb,$url,$validStatuses,$checkCustomHeader]) {
7272
$works = null;
73-
foreach ($this->runRequest($url, $verb, ['httpErrors' => false, 'options' => ['allow_redirects' => ['track_redirects' => true]]]) as $response) {
73+
foreach ($this->runRequest($verb, $url, ['httpErrors' => false, 'options' => ['allow_redirects' => ['track_redirects' => true]]]) as $response) {
7474
// Check that the response status matches
7575
$works = in_array($response->getStatusCode(), $validStatuses);
7676
// and (if needed) the custom Nextcloud header is set

0 commit comments

Comments
 (0)