Allow access to CSS resources
Fixes https://github.com/nextcloud/server/issues/2984 Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
parent
4f9ff96f79
commit
69f3430552
24
lib/base.php
24
lib/base.php
|
@ -791,23 +791,31 @@ class OC {
|
|||
&& !\OC::$server->getTrustedDomainHelper()->isTrustedDomain($host)
|
||||
&& self::$server->getConfig()->getSystemValue('installed', false)
|
||||
) {
|
||||
header('HTTP/1.1 400 Bad Request');
|
||||
header('Status: 400 Bad Request');
|
||||
// Allow access to CSS resources
|
||||
$isScssRequest = false;
|
||||
if(strpos($request->getPathInfo(), '/css/') === 0) {
|
||||
$isScssRequest = true;
|
||||
}
|
||||
|
||||
\OC::$server->getLogger()->warning(
|
||||
if (!$isScssRequest) {
|
||||
header('HTTP/1.1 400 Bad Request');
|
||||
header('Status: 400 Bad Request');
|
||||
|
||||
\OC::$server->getLogger()->warning(
|
||||
'Trusted domain error. "{remoteAddress}" tried to access using "{host}" as host.',
|
||||
[
|
||||
'app' => 'core',
|
||||
'remoteAddress' => $request->getRemoteAddress(),
|
||||
'host' => $host,
|
||||
]
|
||||
);
|
||||
);
|
||||
|
||||
$tmpl = new OCP\Template('core', 'untrustedDomain', 'guest');
|
||||
$tmpl->assign('domain', $host);
|
||||
$tmpl->printPage();
|
||||
$tmpl = new OCP\Template('core', 'untrustedDomain', 'guest');
|
||||
$tmpl->assign('domain', $host);
|
||||
$tmpl->printPage();
|
||||
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
}
|
||||
\OC::$server->getEventLogger()->end('boot');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue