Skip to content

Commit

Permalink
Disable CSP headers for Selenium requests
Browse files Browse the repository at this point in the history
See comment. Should allow scripts to run on e.g. the account creation
form and other secure forms. Needed in a subsequent commit to access
`window.MB` in a Selenium command.
  • Loading branch information
mwiencek committed Feb 23, 2023
1 parent d6329b5 commit 1e9c3bf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/MusicBrainz/Server.pm
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ before dispatch => sub {
my $cache_namespace = DBDefs->CACHE_NAMESPACE;
*DBDefs::CACHE_NAMESPACE = sub { $cache_namespace . $database . ':' };
*DBDefs::ENTITY_CACHE_TTL = sub { 1 };
# CSP script-src directives conflict with `Function` constructor calls
# injected by babel-plugin-instanbul (unsafe-eval).
$self->res->header('Content-Security-Policy', '');
} else {
# Use a fresh database connection for every request, and
# remember to disconnect at the end.
Expand Down

0 comments on commit 1e9c3bf

Please sign in to comment.