Skip to content

Commit

Permalink
Merge pull request #229 from dotkernel/v3/feature/dot-response-header
Browse files Browse the repository at this point in the history
Issue #228: Implemented dot-response-header and added FLoC header.
  • Loading branch information
arhimede authored May 20, 2021
2 parents c363a91 + ddf9a14 commit 400c955
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"dotkernel/dot-navigation": "^3.1",
"dotkernel/dot-rbac": "^3.2",
"dotkernel/dot-rbac-guard": "^3.1",
"dotkernel/dot-response-header": "^3.0",
"dotkernel/dot-session": "^4.2",
"dotkernel/dot-twigrenderer": "^3.1.1",
"laminas/laminas-authentication": "^2.7",
Expand Down
27 changes: 27 additions & 0 deletions config/autoload/response-header.global.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

return [
'dot_response_headers' => [
/**
* Global headers - applied to all routes
*/
'*' => [
'permissions-policy' => [
'value' => 'interest-cohort=()',
'overwrite' => true,
],
],

/**
* Route-specific headers
*/
// 'route-name' => [
// 'header-name' => [
// 'value' => 'header-value',
// 'overwrite' => true,
// ]
// ],
]
];
1 change: 1 addition & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class_exists(\Mezzio\Swoole\ConfigProvider::class)
\Dot\FlashMessenger\ConfigProvider::class,
\Dot\Rbac\ConfigProvider::class,
\Dot\Rbac\Guard\ConfigProvider::class,
\Dot\ResponseHeader\ConfigProvider::class,

// Default App module config
\Frontend\App\ConfigProvider::class,
Expand Down
3 changes: 2 additions & 1 deletion config/pipeline.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
declare(strict_types=1);

use Dot\ErrorHandler\ErrorHandlerInterface;
use Laminas\Stratigility\Middleware\ErrorHandler;
use Dot\ResponseHeader\Middleware\ResponseHeaderMiddleware;
use Mezzio\Application;
use Mezzio\Handler\NotFoundHandler;
use Mezzio\Helper\ServerUrlMiddleware;
Expand Down Expand Up @@ -56,6 +56,7 @@
// Register the routing middleware in the middleware pipeline.
// This middleware registers the Mezzio\Router\RouteResult request attribute.
$app->pipe(RouteMiddleware::class);
$app->pipe(ResponseHeaderMiddleware::class);



Expand Down

0 comments on commit 400c955

Please sign in to comment.