LibWeb/CSP: Implement the default-src directive

This commit is contained in:
Luke Wilde
2024-12-03 18:18:50 +00:00
committed by Shannon Booth
parent 25425f63ba
commit c5748437db
Notes: github-actions[bot] 2025-07-19 05:16:25 +00:00
5 changed files with 108 additions and 0 deletions

View File

@@ -6,6 +6,7 @@
#include <LibJS/Runtime/Realm.h>
#include <LibWeb/ContentSecurityPolicy/Directives/ConnectSourceDirective.h>
#include <LibWeb/ContentSecurityPolicy/Directives/DefaultSourceDirective.h>
#include <LibWeb/ContentSecurityPolicy/Directives/Directive.h>
#include <LibWeb/ContentSecurityPolicy/Directives/DirectiveFactory.h>
#include <LibWeb/ContentSecurityPolicy/Directives/FontSourceDirective.h>
@@ -30,6 +31,9 @@ GC::Ref<Directive> create_directive(GC::Heap& heap, String name, Vector<String>
if (name == Names::ConnectSrc)
return heap.allocate<ConnectSourceDirective>(move(name), move(value));
if (name == Names::DefaultSrc)
return heap.allocate<DefaultSourceDirective>(move(name), move(value));
if (name == Names::FontSrc)
return heap.allocate<FontSourceDirective>(move(name), move(value));