mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +02:00
LibWeb/CSP: Implement the frame-src directive
This commit is contained in:
committed by
Shannon Booth
parent
e899438907
commit
1689353beb
Notes:
github-actions[bot]
2025-07-05 09:23:00 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/1689353beb4 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5276 Reviewed-by: https://github.com/shannonbooth ✅
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) 2024, Luke Wilde <luke@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/ContentSecurityPolicy/Directives/Directive.h>
|
||||
|
||||
namespace Web::ContentSecurityPolicy::Directives {
|
||||
|
||||
// https://w3c.github.io/webappsec-csp/#directive-frame-src
|
||||
class FrameSourceDirective final : public Directive {
|
||||
GC_CELL(FrameSourceDirective, Directive)
|
||||
GC_DECLARE_ALLOCATOR(FrameSourceDirective);
|
||||
|
||||
public:
|
||||
virtual ~FrameSourceDirective() = default;
|
||||
|
||||
[[nodiscard]] virtual Result pre_request_check(GC::Heap&, GC::Ref<Fetch::Infrastructure::Request const>, GC::Ref<Policy const>) const override;
|
||||
[[nodiscard]] virtual Result post_request_check(GC::Heap&, GC::Ref<Fetch::Infrastructure::Request const>, GC::Ref<Fetch::Infrastructure::Response const>, GC::Ref<Policy const>) const override;
|
||||
|
||||
private:
|
||||
FrameSourceDirective(String name, Vector<String> value);
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user