When running locally with .example.com domain use http

This commit is contained in:
Rafael Caricio 2023-04-24 16:10:50 +02:00
parent 83286b7522
commit ad3ea0e7ca
Signed by: rafaelcaricio
GPG key ID: 3C86DBCE8E93C947

View file

@ -14,7 +14,7 @@ pub fn get_hostname(url: &str) -> Result<String, ParseError> {
}
pub fn guess_protocol(hostname: &str) -> &'static str {
if hostname == "localhost" {
if hostname == "localhost" || hostname.ends_with(".example.com") {
return "http";
};
let maybe_ipv4_address = hostname.parse::<Ipv4Addr>();