mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 22:02:44 +00:00 
			
		
		
		
	 4629f2e4ad
			
		
	
	
		4629f2e4ad
		
	
	
	
	
		
			
			This namespace will be used for all interfaces defined in the URL specification, like URL and URLSearchParams. This has the unfortunate side-effect of requiring us to use the fully qualified AK::URL name whenever we want to refer to the AK class, so this commit also fixes all such references.
		
			
				
	
	
		
			27 lines
		
	
	
	
		
			565 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
	
		
			565 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, Tim Flynn <trflynn89@pm.me>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include "LoadRequest.h"
 | |
| #include <LibWeb/Cookie/Cookie.h>
 | |
| #include <LibWeb/Page/Page.h>
 | |
| 
 | |
| namespace Web {
 | |
| 
 | |
| LoadRequest LoadRequest::create_for_url_on_page(const AK::URL& url, Page* page)
 | |
| {
 | |
|     LoadRequest request;
 | |
|     request.set_url(url);
 | |
| 
 | |
|     if (page) {
 | |
|         String cookie = page->client().page_did_request_cookie(url, Cookie::Source::Http);
 | |
|         if (!cookie.is_empty())
 | |
|             request.set_header("Cookie", cookie);
 | |
|     }
 | |
| 
 | |
|     return request;
 | |
| }
 | |
| 
 | |
| }
 |