[ticket/17010] Remove no longer used route & handler

PHPBB3-17010
This commit is contained in:
Marc Alexander 2023-11-05 14:38:52 +01:00
parent 8d9a7aa62c
commit bfc3a969ee
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
2 changed files with 0 additions and 37 deletions

View file

@ -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 }

View file

@ -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
*