summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohannes Ernst <jernst@indiecomputing.com>2016-07-06 23:51:04 +0000
committerJohannes Ernst <jernst@indiecomputing.com>2016-07-06 23:51:04 +0000
commit66a134e69e45cfe507c19983760035a3beb48f8a (patch)
tree8e4c98a0b1a2f2bdef9d4a95112c5f0ae77a47ae /tests
parent2b4ceae620261a5433aa12acf5e2b385aef40ab8 (diff)
downloadnextcloud-server-66a134e69e45cfe507c19983760035a3beb48f8a.tar.gz
nextcloud-server-66a134e69e45cfe507c19983760035a3beb48f8a.zip
Disallow certain malformed domain names even if they match the trusted domain expression
Stricter checking for valid domain names
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Security/TrustedDomainHelperTest.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/lib/Security/TrustedDomainHelperTest.php b/tests/lib/Security/TrustedDomainHelperTest.php
index 6c254dcaa79..1beb7a66717 100644
--- a/tests/lib/Security/TrustedDomainHelperTest.php
+++ b/tests/lib/Security/TrustedDomainHelperTest.php
@@ -102,6 +102,10 @@ class TrustedDomainHelperTest extends \Test\TestCase {
[$trustedHostTestList, 'abc.leadingwith.port:1234', false],
[$trustedHostTestList, 'trailingwith.port.abc:456', true],
[$trustedHostTestList, 'trailingwith.port.abc:123', false],
+ // bad hostname
+ [$trustedHostTestList, '-bad', false],
+ [$trustedHostTestList, '-bad.leading.host', false],
+ [$trustedHostTestList, 'bad..der.leading.host', false],
];
}
}