diff --git a/phpBB/config/default/routing/ucp.yml b/phpBB/config/default/routing/ucp.yml index dac6461ac5..772910bfe1 100644 --- a/phpBB/config/default/routing/ucp.yml +++ b/phpBB/config/default/routing/ucp.yml @@ -21,7 +21,3 @@ phpbb_ucp_push_subscribe_controller: phpbb_ucp_push_unsubscribe_controller: path: /push/unsubscribe defaults: { _controller: phpbb.ucp.controller.webpush:unsubscribe } - -phpbb_ucp_push_js_controller: - path: /push/js - defaults: { _controller: phpbb.ucp.controller.webpush:js } diff --git a/phpBB/phpbb/ucp/controller/webpush.php b/phpBB/phpbb/ucp/controller/webpush.php index a9b5e133cf..79f6b110cc 100644 --- a/phpBB/phpbb/ucp/controller/webpush.php +++ b/phpBB/phpbb/ucp/controller/webpush.php @@ -187,39 +187,6 @@ class webpush } } - /** - * Handle request to web push javascript - * - * @return Response - * @throws LoaderError - * @throws RuntimeError - * @throws SyntaxError - */ - public function js(): Response - { - // @todo: return forbidden for guest & bot - - $template_data = $this->get_subscribe_vars(); - $template_data += [ - 'VAPID_PUBLIC_KEY' => $this->config['webpush_vapid_public'], - 'U_WEBPUSH_WORKER_URL' => $this->controller_helper->route('phpbb_ucp_push_worker_controller'), - 'SUBSCRIPTIONS' => $this->get_subscriptions(), - ]; - - $content = $this->template->render('webpush.js.twig', $template_data); - - $response = new Response($content); - $response->headers->set('Content-Type', 'text/javascript; charset=UTF-8'); - - if (!empty($this->user->data['is_bot'])) - { - // Let reverse proxies know we detected a bot. - $response->headers->set('X-PHPBB-IS-BOT', 'yes'); - } - - return $response; - } - /** * Handle subscribe requests *