LibWeb/CSP: Implement the script-src directive

This commit is contained in:
Luke Wilde 2024-12-02 16:01:19 +00:00 committed by Andrew Kaster
commit 0cff47828d
Notes: github-actions[bot] 2025-07-09 21:53:59 +00:00
17 changed files with 839 additions and 14 deletions

View file

@ -15,6 +15,7 @@
#include <LibWeb/ContentSecurityPolicy/Directives/MediaSourceDirective.h>
#include <LibWeb/ContentSecurityPolicy/Directives/Names.h>
#include <LibWeb/ContentSecurityPolicy/Directives/ObjectSourceDirective.h>
#include <LibWeb/ContentSecurityPolicy/Directives/ScriptSourceDirective.h>
namespace Web::ContentSecurityPolicy::Directives {
@ -41,6 +42,9 @@ GC::Ref<Directive> create_directive(GC::Heap& heap, String name, Vector<String>
if (name == Names::ObjectSrc)
return heap.allocate<ObjectSourceDirective>(move(name), move(value));
if (name == Names::ScriptSrc)
return heap.allocate<ScriptSourceDirective>(move(name), move(value));
return heap.allocate<Directive>(move(name), move(value));
}