diff options
author | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2024-07-09 18:21:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-09 18:21:47 +0200 |
commit | e395d1f6933a0cc4f216c4a2d68c679ec14d64ae (patch) | |
tree | 8230aed162bee74d6c0ca4680c35cd1f34b185f0 /apps/settings | |
parent | 19ab1ffd0b7a95430a9bd83d63ff5c52175c3280 (diff) | |
parent | fa55d97dded9ab3edcd9bb13be7a0afca275f6aa (diff) | |
download | nextcloud-server-e395d1f6933a0cc4f216c4a2d68c679ec14d64ae.tar.gz nextcloud-server-e395d1f6933a0cc4f216c4a2d68c679ec14d64ae.zip |
Merge pull request #46302 from nextcloud/fix/noid/jsm-check-pickiness
[stable28] fix(SetupCheck): jsm test shall not give up with first no-response
Diffstat (limited to 'apps/settings')
-rw-r--r-- | apps/settings/lib/SetupChecks/JavaScriptModules.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/settings/lib/SetupChecks/JavaScriptModules.php b/apps/settings/lib/SetupChecks/JavaScriptModules.php index c1234a9ff15..446c4d9d8d7 100644 --- a/apps/settings/lib/SetupChecks/JavaScriptModules.php +++ b/apps/settings/lib/SetupChecks/JavaScriptModules.php @@ -61,6 +61,7 @@ class JavaScriptModules implements ISetupCheck { array_map(fn (string $host): string => $host . $testFile, $this->config->getSystemValue('trusted_domains', [])) ); + $gotResponse = false; foreach ($testURLs as $testURL) { try { $client = $this->clientService->newClient(); @@ -73,14 +74,17 @@ class JavaScriptModules implements ISetupCheck { 'allow_local_address' => true, ], ]); + $gotResponse = true; if (preg_match('/(text|application)\/javascript/i', $response->getHeader('Content-Type'))) { return SetupResult::success(); } } catch (\Throwable $e) { $this->logger->debug('Can not connect to local server for checking JavaScript modules support', ['exception' => $e, 'url' => $testURL]); - return SetupResult::warning($this->l10n->t('Could not check for JavaScript support. Please check manually if your webserver serves `.mjs` files using the JavaScript MIME type.')); } } + if (!$gotResponse) { + return SetupResult::warning($this->l10n->t('Could not check for JavaScript support. Please check manually if your webserver serves `.mjs` files using the JavaScript MIME type.')); + } return SetupResult::error($this->l10n->t('Your webserver does not serve `.mjs` files using the JavaScript MIME type. This will break some apps by preventing browsers from executing the JavaScript files. You should configure your webserver to serve `.mjs` files with either the `text/javascript` or `application/javascript` MIME type.')); } } |