Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-06 02:38:00 +01:00
make domain protocol validation work with multi-domains
Dieser Commit ist enthalten in:
Ursprung
2c7b739d49
Commit
e313745f7c
1 geänderte Dateien mit 9 neuen und 5 gelöschten Zeilen
|
@ -733,11 +733,13 @@ fn validate_config(cfg: &ConfigItems) -> Result<(), Error> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let dom = cfg.domain.to_lowercase();
|
let domains = cfg.domain_change_back.split(',').map(|d| d.to_string().to_lowercase());
|
||||||
if !dom.starts_with("http://") && !dom.starts_with("https://") {
|
for dom in domains {
|
||||||
err!(
|
if !dom.starts_with("http://") && !dom.starts_with("https://") {
|
||||||
"DOMAIN variable needs to contain the protocol (http, https). Use 'http[s]://bw.example.com' instead of 'bw.example.com'"
|
err!(
|
||||||
);
|
"DOMAIN variable needs to contain the protocol (http, https). Use 'http[s]://bw.example.com' instead of 'bw.example.com'"
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let whitelist = &cfg.signups_domains_whitelist;
|
let whitelist = &cfg.signups_domains_whitelist;
|
||||||
|
@ -1314,6 +1316,8 @@ impl Config {
|
||||||
}).get(host).map(|h| h.clone())
|
}).get(host).map(|h| h.clone())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Yes this is a base_url
|
||||||
|
// But the configuration precedent says, that we call this a domain.
|
||||||
pub fn main_domain(&self) -> String {
|
pub fn main_domain(&self) -> String {
|
||||||
self.domain_change_back().split(',').nth(0).expect("Missing domain").to_string()
|
self.domain_change_back().split(',').nth(0).expect("Missing domain").to_string()
|
||||||
}
|
}
|
||||||
|
|
Laden …
In neuem Issue referenzieren