diff options
| author | Sebastien Bacher <seb128@ubuntu.com> | 2021-08-25 15:24:42 +0200 |
|---|---|---|
| committer | Sebastien Bacher <seb128@ubuntu.com> | 2021-08-25 15:24:42 +0200 |
| commit | dbb91282fa488964fb20595f9494a9f0e4f36a58 (patch) | |
| tree | 142bc942e5320b35514cdf03a5f9f47a9b89df0e /src/nm-cloud-setup/nmcs-provider-ec2.c | |
| parent | 5f2ede3a2813b0e9204befdcfc67509d34be71c6 (diff) | |
| parent | cfb80376641fa49137b9996130352697e7f8b436 (diff) | |
Update upstream source from tag 'upstream/1.32.10'
Update to upstream version '1.32.10' with Debian dir fcf2778b50b013ede3e7375bc1d829e984175658
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; |