mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibWeb/CSP: Implement the connect-src directive
This commit is contained in:
parent
203c2a6b30
commit
959bb5cc18
Notes:
github-actions[bot]
2025-07-05 09:23:11 +00:00
Author: https://github.com/Lubrsi
Commit: 959bb5cc18
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5276
Reviewed-by: https://github.com/shannonbooth ✅
7 changed files with 124 additions and 0 deletions
|
@ -5,13 +5,18 @@
|
|||
*/
|
||||
|
||||
#include <LibJS/Runtime/Realm.h>
|
||||
#include <LibWeb/ContentSecurityPolicy/Directives/ConnectSourceDirective.h>
|
||||
#include <LibWeb/ContentSecurityPolicy/Directives/Directive.h>
|
||||
#include <LibWeb/ContentSecurityPolicy/Directives/DirectiveFactory.h>
|
||||
#include <LibWeb/ContentSecurityPolicy/Directives/Names.h>
|
||||
|
||||
namespace Web::ContentSecurityPolicy::Directives {
|
||||
|
||||
GC::Ref<Directive> create_directive(GC::Heap& heap, String name, Vector<String> value)
|
||||
{
|
||||
if (name == Names::ConnectSrc)
|
||||
return heap.allocate<ConnectSourceDirective>(move(name), move(value));
|
||||
|
||||
return heap.allocate<Directive>(move(name), move(value));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue