Skip to content

Commit

Permalink
Merge pull request #333 from fritzmg/view-source-filter
Browse files Browse the repository at this point in the history
Filter `view-source` reports
  • Loading branch information
Seldaek committed Jan 17, 2024
2 parents da7cc88 + 6b987b7 commit 9ae9fab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public function match(Report $report, Request $request): bool
}
}

// https://bugzilla.mozilla.org/show_bug.cgi?id=1873553
if ('view-source' === $report->getSourceFile()) {
return true;
}

// files loaded by safari & firefox extension
// should be allowed as in Chrome
if (
Expand Down
5 changes: 5 additions & 0 deletions tests/ContentSecurityPolicy/Violation/FilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ public function provideVariousCases(): array
'blocked-uri' => 'www.gstatic.com',
'effective-directive' => 'script-src',
]],
[true, new Request(), [
'blocked-uri' => 'inline',
'source-file' => 'view-source',
'effective-directive' => 'style-src-attr',
]],
];
}
}

0 comments on commit 9ae9fab

Please sign in to comment.