diff options
| author | Sebastien Bacher <seb128@ubuntu.com> | 2021-08-25 15:23:22 +0200 |
|---|---|---|
| committer | Sebastien Bacher <seb128@ubuntu.com> | 2021-08-25 15:23:22 +0200 |
| commit | cfb80376641fa49137b9996130352697e7f8b436 (patch) | |
| tree | 4ac3eb90a08f27a8bff2372052f8ae78f7e7c3aa /src/nm-cloud-setup/nmcs-provider-ec2.c | |
| parent | 35779c6675728fa6f0fd0a21cefb904408509c23 (diff) | |
New upstream version 1.32.10
Diffstat (limited to 'src/nm-cloud-setup/nmcs-provider-ec2.c')
| -rw-r--r-- | src/nm-cloud-setup/nmcs-provider-ec2.c | 16 |
1 files changed, 1 insertions, 15 deletions
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; |