1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kanboard_ynh.git synced 2024-09-03 19:36:17 +02:00
kanboard_ynh/sources/app/Middleware/BootstrapMiddleware.php
2016-07-23 14:11:39 +02:00

44 lines
899 B
PHP

<?php
namespace Kanboard\Middleware;
use Kanboard\Core\Controller\BaseMiddleware;
/**
* Class BootstrapMiddleware
*
* @package Kanboard\Middleware
* @author Frederic Guillot
*/
class BootstrapMiddleware extends BaseMiddleware
{
/**
* Execute middleware
*/
public function execute()
{
$this->sessionManager->open();
$this->dispatcher->dispatch('app.bootstrap');
$this->sendHeaders();
$this->next();
}
/**
* Send HTTP headers
*
* @access private
*/
private function sendHeaders()
{
$this->response->withContentSecurityPolicy($this->container['cspRules']);
$this->response->withSecurityHeaders();
if (ENABLE_XFRAME) {
$this->response->withXframe();
}
if (ENABLE_HSTS) {
$this->response->withStrictTransportSecurity();
}
}
}