LibWeb/CSP: Implement the img-src directive

This commit is contained in:
Luke Wilde 2024-11-29 11:21:17 +00:00 committed by Shannon Booth
commit 715061fb79
Notes: github-actions[bot] 2025-07-05 09:22:55 +00:00
5 changed files with 95 additions and 0 deletions

View file

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