Skip to content

Commit 4dc224f

Browse files
authored
Merge pull request #42999 from nextcloud/fix/mjs-setup-check-local
2 parents 5a7b145 + d2cb90b commit 4dc224f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

apps/settings/lib/SetupChecks/JavaScriptModules.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,18 @@ public function run(): SetupResult {
6464
foreach ($testURLs as $testURL) {
6565
try {
6666
$client = $this->clientService->newClient();
67-
$response = $client->head($testURL, ['connect_timeout' => 10]);
67+
$response = $client->head($testURL, [
68+
'connect_timeout' => 10,
69+
'nextcloud' => [
70+
'allow_local_address' => true,
71+
],
72+
]);
6873
if (preg_match('/(text|application)\/javascript/i', $response->getHeader('Content-Type'))) {
6974
return SetupResult::success();
7075
}
7176
} catch (\Throwable $e) {
7277
$this->logger->debug('Can not connect to local server for checking JavaScript modules support', ['exception' => $e, 'url' => $testURL]);
78+
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.'));
7379
}
7480
}
7581
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.'));

0 commit comments

Comments
 (0)