mirror of
https://github.com/humhub/humhub.git
synced 2025-01-16 21:58:17 +01:00
Support serving /manifest.json, /sw.js, & /offline.pwa.html (#6461)
This commit is contained in:
parent
9dba5ef34d
commit
640a6693d2
@ -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
|
||||
|
@ -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|(?<!manifest\.)json|(?<!sw\.)js|png|jpg|jpeg|gif|ttf|woff|woff2)(\?.+)?$/i', $_SERVER['REQUEST_URI'])) {
|
||||
return false; // serve the requested resource as-is.
|
||||
}
|
||||
|
||||
|
@ -47,6 +47,10 @@ class Request extends \yii\web\Request
|
||||
if ($this->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');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user