mirror of
				https://github.com/dani-garcia/vaultwarden.git
				synced 2025-10-31 02:08:20 +02:00 
			
		
		
		
	Change host url to https when it's enabled, should fix some problems downloading attachments
This commit is contained in:
		| @@ -111,7 +111,11 @@ impl<'a, 'r> FromRequest<'a, 'r> for Headers { | ||||
|  | ||||
|         // Get host | ||||
|         let host = match headers.get_one("Host") { | ||||
|             Some(host) => format!("http://{}", host), // TODO: Check if HTTPS | ||||
|             Some(host) => { | ||||
|                 use std::env; | ||||
|                 let protocol = if env::var("ROCKET_TLS").is_ok() {"https"} else {"http"}; | ||||
|                 format!("{}://{}", protocol, host) | ||||
|             }, | ||||
|             _ => String::new() | ||||
|         }; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user