Skip to content

Commit

Permalink
Allow access to CSS resources
Browse files Browse the repository at this point in the history
Fixes #2984

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
  • Loading branch information
LukasReschke committed Jan 9, 2017
1 parent 4f9ff96 commit d9a79b5
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -791,23 +791,31 @@ public static function init() {
&& !\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(\OC::$server->getRequest()->getPathInfo(), '/css/') === 0) {
$isScssRequest = true;
}

if (!$isScssRequest) {
header('HTTP/1.1 400 Bad Request');
header('Status: 400 Bad Request');

\OC::$server->getLogger()->warning(
\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');
}
Expand Down

0 comments on commit d9a79b5

Please sign in to comment.