mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWeb/CSP: Implement the style-src directive
This commit is contained in:
parent
d1abd11b78
commit
8b0b3b186f
Notes:
github-actions[bot]
2025-07-17 23:59:22 +00:00
Author: https://github.com/Lubrsi
Commit: 8b0b3b186f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5490
Reviewed-by: https://github.com/shannonbooth ✅
6 changed files with 130 additions and 1 deletions
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* 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-style-src
|
||||
class StyleSourceDirective final : public Directive {
|
||||
GC_CELL(StyleSourceDirective, Directive)
|
||||
GC_DECLARE_ALLOCATOR(StyleSourceDirective);
|
||||
|
||||
public:
|
||||
virtual ~StyleSourceDirective() = default;
|
||||
|
||||
virtual Result pre_request_check(GC::Heap&, GC::Ref<Fetch::Infrastructure::Request const>, GC::Ref<Policy const>) const override;
|
||||
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;
|
||||
virtual Result inline_check(GC::Heap&, GC::Ptr<DOM::Element const>, InlineType, GC::Ref<Policy const>, String const&) const override;
|
||||
|
||||
private:
|
||||
StyleSourceDirective(String name, Vector<String> value);
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue