Skip to content

Commit

Permalink
fix: remove /up route - not compatibile with laravel-csp
Browse files Browse the repository at this point in the history
  • Loading branch information
fredbradley committed Apr 10, 2024
1 parent 73d04ba commit 000d8e6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
12 changes: 1 addition & 11 deletions app/Http/ContentSecurityPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,10 @@

class ContentSecurityPolicy extends Basic
{
private function forUpPage()
{
$this->addDirective(Directive::SCRIPT, 'self');
$this->addDirective(Directive::STYLE, 'self');
$this->addDirective(Directive::STYLE, 'fonts.bunny.net');
$this->addDirective(Directive::SCRIPT, 'cdn.tailwindcss.com');
}
public function configure()
public function configure(): void
{
parent::configure();
if (app()->environment('production')) {
if (request()->is('up')) {
$this->forUpPage();
}
$this
->addDirective(Directive::SCRIPT, 'self')
->addDirective(Directive::STYLE, 'self')
Expand Down
1 change: 0 additions & 1 deletion bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
apiPrefix: 'api',
web: __DIR__.'/../routes/web.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
then: function () {
foreach (['raiseaconcern', 'selfreflection'] as $route) {
Route::domain(config('app.domains.'.$route.'.url'))
Expand Down

0 comments on commit 000d8e6

Please sign in to comment.