Skip to content

Commit

Permalink
NEW common HTTP headers for all facades in System.config.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrej Kabachnik committed Jan 24, 2024
1 parent 3f1f560 commit 8517f56
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Facades/IDEFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ protected function launchAdminer() : ?string
*/
protected function buildHeadersCommon() : array
{
$headers = array_filter($this->getConfig()->getOption('FACADE.HEADERS.COMMON')->toArray());
$baseHeaders = parent::buildHeadersCommon();
$facadeHeaders = array_filter($this->getConfig()->getOption('FACADE.HEADERS.COMMON')->toArray());

$workbenchHosts = [];
foreach ($this->getWorkbench()->getConfig()->getOption('SERVER.BASE_URLS') as $url) {
Expand Down Expand Up @@ -316,6 +317,7 @@ protected function buildHeadersCommon() : array
}
}

return array_merge(['Content-Security-Policy' => $cspString], $headers);
$secPolHeaders = ['Content-Security-Policy' => $cspString];
return array_merge($baseHeaders, $secPolHeaders, $facadeHeaders);
}
}

0 comments on commit 8517f56

Please sign in to comment.