diff --git a/CHANGELOG-DEV.md b/CHANGELOG-DEV.md index 495c863ea0..cafd59be22 100644 --- a/CHANGELOG-DEV.md +++ b/CHANGELOG-DEV.md @@ -3,6 +3,7 @@ HumHub Changelog 1.15.0 (Unreleased) ------------------- +- Fix #6461: Test server support to serve web module's `/manifest.json`, `/sw.js`, & `/offline.pwa.html` - Enh #6460: Test server output: print application requests - Fix #6423: log.fata in frontend logging is redirected to log.fatal, which did not work - Fix #6220: User Soft Delete doesn't remove third party auth references diff --git a/index-test.php b/index-test.php index 38cb729e71..beb1c006dc 100644 --- a/index-test.php +++ b/index-test.php @@ -13,7 +13,7 @@ if (!in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'])) { die('You are not allowed to access this file.'); } -if (isset($_SERVER['REQUEST_URI']) && preg_match('/\.(?:css|json|js|png|jpg|jpeg|gif|ttf|woff|woff2)(\?.+)?$/i', $_SERVER['REQUEST_URI'])) { +if (isset($_SERVER['REQUEST_URI']) && preg_match('/^[^?]*\.(?:css|(?cookieValidationKey == '') { $this->cookieValidationKey = 'installer'; } + + if (defined('YII_ENV_TEST') && YII_ENV_TEST && $_SERVER['SCRIPT_FILENAME'] === 'index-test.php' && in_array($_SERVER['SCRIPT_NAME'], ['/sw.js', '/offline.pwa.html', '/manifest.json'], true)) { + $this->setScriptUrl('/index.php'); + } } /**