| 
									
										
										
										
											2024-11-29 11:21:17 +00:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * 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; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-07-05 11:52:34 +01:00
										 |  |  |     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; | 
					
						
							| 
									
										
										
										
											2024-11-29 11:21:17 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     ImageSourceDirective(String name, Vector<String> value); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |