Skip to content

Commit

Permalink
Prevent CSP use with REST API responses
Browse files Browse the repository at this point in the history
Do not send CSP headers with AtoM REST API responses.
  • Loading branch information
sbreker committed Oct 31, 2023
1 parent 4ec24ec commit 06178a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/filter/QubitCSPFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function execute($filterChain)

$filterChain->execute();

if (false !== strpos($context->response->getContentType(), 'text/xml')) {
if (preg_match('~(text/xml|application/json)~', $context->response->getContentType())) {
return;
}

Expand Down
4 changes: 4 additions & 0 deletions plugins/arRestApiPlugin/modules/api/config/filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ restApiFilter:
class: arRestApiPluginFilter

QubitTransaction: ~

QubitCSP:
enable: false

cache: ~
execution: ~

0 comments on commit 06178a0

Please sign in to comment.