mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
LibWeb/CSP: Implement the img-src directive
This commit is contained in:
parent
1689353beb
commit
715061fb79
Notes:
github-actions[bot]
2025-07-05 09:22:55 +00:00
Author: https://github.com/Lubrsi
Commit: 715061fb79
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5276
Reviewed-by: https://github.com/shannonbooth ✅
5 changed files with 95 additions and 0 deletions
|
@ -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-img-src
|
||||
class ImageSourceDirective final : public Directive {
|
||||
GC_CELL(ImageSourceDirective, Directive)
|
||||
GC_DECLARE_ALLOCATOR(ImageSourceDirective);
|
||||
|
||||
public:
|
||||
virtual ~ImageSourceDirective() = 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:
|
||||
ImageSourceDirective(String name, Vector<String> value);
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue