From e371ca99bef4db1838f60c46c1d4d92790dc81e2 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Thu, 21 Jul 2022 13:19:39 +0200 Subject: [PATCH] Allow all internal hosts to be http-only Signed-off-by: jld3103 --- lib/Controller/PushController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Controller/PushController.php b/lib/Controller/PushController.php index 8d86d8123..6693aaedf 100644 --- a/lib/Controller/PushController.php +++ b/lib/Controller/PushController.php @@ -100,7 +100,7 @@ public function registerDevice(string $pushTokenHash, string $devicePublicKey, s if ( !filter_var($proxyServer, FILTER_VALIDATE_URL) || \strlen($proxyServer) > 256 || - !preg_match('/^(https\:\/\/|http\:\/\/localhost(\:\d{0,5})?\/)/', $proxyServer) + !preg_match('/^(https\:\/\/|http\:\/\/(localhost|[a-z0-9\.-]*\.(internal|local))(\:\d{0,5})?\/)/', $proxyServer) ) { return new DataResponse(['message' => 'INVALID_PROXY_SERVER'], Http::STATUS_BAD_REQUEST); }