aboutsummaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-11-10 11:13:25 +0100
committerLukas Reschke <lukas@owncloud.com>2015-11-10 12:02:10 +0100
commitba67dd9818696661d290c319a06bdc43ef6241d3 (patch)
tree86009aae625c209d78862c1eed593a12c43ac9be /lib/base.php
parent422d29ae48fe0646b1b5b633b205ea146d9ed69f (diff)
downloadnextcloud-server-ba67dd9818696661d290c319a06bdc43ef6241d3.tar.gz
nextcloud-server-ba67dd9818696661d290c319a06bdc43ef6241d3.zip
Add warning log entry when user accesses untrusted domain
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/base.php b/lib/base.php
index f44c4ff5bf2..feaf46e83f1 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -673,6 +673,15 @@ class OC {
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', $request->server['SERVER_NAME']);
$tmpl->printPage();