LibWeb/CSP: Implement the frame-src directive

This commit is contained in:
Luke Wilde 2024-11-29 11:08:12 +00:00 committed by Shannon Booth
commit 1689353beb
Notes: github-actions[bot] 2025-07-05 09:23:00 +00:00
5 changed files with 95 additions and 0 deletions

View file

@ -9,6 +9,7 @@
#include <LibWeb/ContentSecurityPolicy/Directives/Directive.h>
#include <LibWeb/ContentSecurityPolicy/Directives/DirectiveFactory.h>
#include <LibWeb/ContentSecurityPolicy/Directives/FontSourceDirective.h>
#include <LibWeb/ContentSecurityPolicy/Directives/FrameSourceDirective.h>
#include <LibWeb/ContentSecurityPolicy/Directives/Names.h>
namespace Web::ContentSecurityPolicy::Directives {
@ -21,6 +22,9 @@ GC::Ref<Directive> create_directive(GC::Heap& heap, String name, Vector<String>
if (name == Names::FontSrc)
return heap.allocate<FontSourceDirective>(move(name), move(value));
if (name == Names::FrameSrc)
return heap.allocate<FrameSourceDirective>(move(name), move(value));
return heap.allocate<Directive>(move(name), move(value));
}