LibWeb/CSP: Implement the form-action directive

This commit is contained in:
Luke Wilde 2024-12-04 11:24:19 +00:00 committed by Alexander Kalenik
commit f9247116b1
Notes: github-actions[bot] 2025-08-06 22:46:59 +00:00
5 changed files with 71 additions and 0 deletions

View file

@ -0,0 +1,27 @@
/*
* 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-form-action
class FormActionDirective final : public Directive {
GC_CELL(FormActionDirective, Directive)
GC_DECLARE_ALLOCATOR(FormActionDirective);
public:
virtual ~FormActionDirective() = default;
virtual Result pre_navigation_check(GC::Ref<Fetch::Infrastructure::Request const>, NavigationType, GC::Ref<Policy const>) const override;
private:
FormActionDirective(String name, Vector<String> value);
};
}