From ad3ea0e7ca70591c340da46ab3ce8512515ca1d2 Mon Sep 17 00:00:00 2001 From: Rafael Caricio Date: Mon, 24 Apr 2023 16:10:50 +0200 Subject: [PATCH] When running locally with .example.com domain use http --- mitra-utils/src/urls.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mitra-utils/src/urls.rs b/mitra-utils/src/urls.rs index 919682f..5b65a59 100644 --- a/mitra-utils/src/urls.rs +++ b/mitra-utils/src/urls.rs @@ -14,7 +14,7 @@ pub fn get_hostname(url: &str) -> Result { } 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::();