From 9ba4e538c4aa362cecfc16d15ae220a1a8bf93f2 Mon Sep 17 00:00:00 2001 From: mo khan Date: Tue, 13 May 2025 14:23:32 -0600 Subject: refactor: loop through each of the loopback addresses --- test/integration/container.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/integration/container.go b/test/integration/container.go index 8f6f219..badb640 100644 --- a/test/integration/container.go +++ b/test/integration/container.go @@ -16,10 +16,9 @@ import ( ) func normalizeIssuer(t *testing.T, issuer string) (string, int) { - issuer = strings.Replace(issuer, "0.0.0.0", testcontainers.HostInternal, 1) - issuer = strings.Replace(issuer, "[::]", testcontainers.HostInternal, 1) - issuer = strings.Replace(issuer, "127.0.0.1", testcontainers.HostInternal, 1) - issuer = strings.Replace(issuer, "localhost", testcontainers.HostInternal, 1) + for _, loopback := range []string{"0.0.0.0", "127.0.0.1", "[::]", "localhost"} { + issuer = strings.Replace(issuer, loopback, testcontainers.HostInternal, 1) + } u, err := url.Parse(issuer) require.NoError(t, err) -- cgit v1.2.3