diff options
author | Joas Schilling <coding@schilljs.com> | 2017-04-05 13:48:15 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-04-05 13:48:15 +0300 |
commit | bd64d6a19dcab9e48fb59247694371fd74547f98 (patch) | |
tree | 25e8f70785ad751bfd4cc7f75608af5e81ed8057 /lib | |
parent | 468017b8454be3165f1ab020cda6ab9bbcb918ea (diff) |
Allow localhost via http
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/PushController.php | 10 |
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); } |