From cfb80376641fa49137b9996130352697e7f8b436 Mon Sep 17 00:00:00 2001 From: Sebastien Bacher Date: Wed, 25 Aug 2021 15:23:22 +0200 Subject: New upstream version 1.32.10 --- src/nm-cloud-setup/nmcs-provider-ec2.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'src/nm-cloud-setup/nmcs-provider-ec2.c') diff --git a/src/nm-cloud-setup/nmcs-provider-ec2.c b/src/nm-cloud-setup/nmcs-provider-ec2.c index 14b0b740..6f83238d 100644 --- a/src/nm-cloud-setup/nmcs-provider-ec2.c +++ b/src/nm-cloud-setup/nmcs-provider-ec2.c @@ -29,21 +29,7 @@ again: * This is mainly for testing, it's not usually supposed to be configured. * Consider this private API! */ base = g_getenv(NMCS_ENV_VARIABLE("NM_CLOUD_SETUP_EC2_HOST")); - - if (base && base[0] && !strchr(base, '/')) { - if (NM_STR_HAS_PREFIX(base, "http://") || NM_STR_HAS_PREFIX(base, "https://")) - base = g_intern_string(base); - else { - gs_free char *s = NULL; - - s = g_strconcat("http://", base, NULL); - base = g_intern_string(s); - } - } - if (!base) - base = NM_EC2_BASE; - - nm_assert(!NM_STR_HAS_SUFFIX(base, "/")); + base = nmcs_utils_uri_complete_interned(base) ?: ("" NM_EC2_BASE); if (!g_atomic_pointer_compare_and_exchange(&base_cached, NULL, base)) goto again; -- cgit 1.3.0-6-gf8a5