Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/notifications.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-04-05 13:48:15 +0300
committerJoas Schilling <coding@schilljs.com>2017-04-05 13:48:15 +0300
commitbd64d6a19dcab9e48fb59247694371fd74547f98 (patch)
tree25e8f70785ad751bfd4cc7f75608af5e81ed8057 /lib/Controller/PushController.php
parent468017b8454be3165f1ab020cda6ab9bbcb918ea (diff)
Allow localhost via http
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Controller/PushController.php')
-rw-r--r--lib/Controller/PushController.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Controller/PushController.php b/lib/Controller/PushController.php
index 36aef01..2739754 100644
--- a/lib/Controller/PushController.php
+++ b/lib/Controller/PushController.php
@@ -96,7 +96,15 @@ class PushController extends OCSController {
return new JSONResponse(['message' => 'INVALID_DEVICE_KEY'], Http::STATUS_BAD_REQUEST);
}
- if (!filter_var($proxyServer, FILTER_VALIDATE_URL) || strpos($proxyServer, 'https://') !== 0 || strlen($proxyServer)> 256) {
+ if (
+ !filter_var($proxyServer, FILTER_VALIDATE_URL) ||
+ strlen($proxyServer) > 256 ||
+ (
+ strpos($proxyServer, 'https://') !== 0 &&
+ strpos($proxyServer, 'http://localhost:') !== 0 &&
+ strpos($proxyServer, 'http://localhost/') !== 0
+ )
+ ) {
return new JSONResponse(['message' => 'INVALID_PROXY_SERVER'], Http::STATUS_BAD_REQUEST);
}