mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-28 11:02:36 +00:00 
			
		
		
		
	 2726fc9c73
			
		
	
	
		2726fc9c73
		
	
	
	
	
		
			
			The Fetch spec unfortunately will cause a name clash between the Request concept and the Request JS object - both cannot live in the Web::Fetch namespace, and WrapperGenerator generally assumes `Web::<Name>` for things living in the `<Name>/` subdirectory, so let's instead move infra code into its own namespace - it already sits in a (sub-)subdirectory anyway.
		
			
				
	
	
		
			18 lines
		
	
	
	
		
			426 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
	
		
			426 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <LibWeb/Fetch/Infrastructure/URL.h>
 | |
| 
 | |
| namespace Web::Fetch::Infrastructure {
 | |
| 
 | |
| // https://fetch.spec.whatwg.org/#is-local
 | |
| bool is_local_url(AK::URL const& url)
 | |
| {
 | |
|     // A URL is local if its scheme is a local scheme.
 | |
|     return any_of(LOCAL_SCHEMES, [&](auto scheme) { return url.scheme() == scheme; });
 | |
| }
 | |
| 
 | |
| }
 |