LibWeb/CSP: Implement the style-src directive

This commit is contained in:
Luke Wilde 2024-12-03 16:57:18 +00:00 committed by Shannon Booth
commit 8b0b3b186f
Notes: github-actions[bot] 2025-07-17 23:59:22 +00:00
6 changed files with 130 additions and 1 deletions

View file

@ -18,6 +18,7 @@
#include <LibWeb/ContentSecurityPolicy/Directives/ScriptSourceAttributeDirective.h>
#include <LibWeb/ContentSecurityPolicy/Directives/ScriptSourceDirective.h>
#include <LibWeb/ContentSecurityPolicy/Directives/ScriptSourceElementDirective.h>
#include <LibWeb/ContentSecurityPolicy/Directives/StyleSourceDirective.h>
namespace Web::ContentSecurityPolicy::Directives {
@ -53,6 +54,9 @@ GC::Ref<Directive> create_directive(GC::Heap& heap, String name, Vector<String>
if (name == Names::ScriptSrcElem)
return heap.allocate<ScriptSourceElementDirective>(move(name), move(value));
if (name == Names::StyleSrc)
return heap.allocate<StyleSourceDirective>(move(name), move(value));
return heap.allocate<Directive>(move(name), move(value));
}