Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-22 05:10:29 +01:00
Change host url to https when it's enabled, should fix some problems downloading attachments
Dieser Commit ist enthalten in:
Ursprung
ec37004dfe
Commit
e88d8c856d
1 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
|
@ -111,7 +111,11 @@ impl<'a, 'r> FromRequest<'a, 'r> for Headers {
|
||||||
|
|
||||||
// Get host
|
// Get host
|
||||||
let host = match headers.get_one("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()
|
_ => String::new()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Laden …
In neuem Issue referenzieren