Skip to content

Commit 402dade

Browse files
committed
Enforce IPV4 by using 127.0.0.1 as localhost
Signed-off-by: Ulysses Souza <[email protected]>
1 parent 19cd13a commit 402dade

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

compliance_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ import (
77
)
88

99
const (
10-
pingEntrypoint = "http://localhost:8080/ping"
10+
localhost = "127.0.0.1"
11+
pingEntrypoint = "http://" + localhost + ":8080/ping"
1112
pingTargetUrl = "target:8080/ping"
1213
pingUrl = pingEntrypoint + "?address=" + pingTargetUrl
1314

14-
volumefileEntrypoint = "http://localhost:8080/volumefile"
15+
volumefileEntrypoint = "http://" + localhost + ":8080/volumefile"
1516
volumeUrl = volumefileEntrypoint + "?filename="
1617
)
1718

@@ -45,7 +46,7 @@ func TestSimpleNetworkFail(t *testing.T) {
4546
specRef: "Networks-top-level-element",
4647
}
4748
h.TestUpDown(func() {
48-
actual := h.getHttpBody("http://localhost:8080/ping?address=notatarget:8080/ping")
49+
actual := h.getHttpBody(pingEntrypoint + "?address=notatarget:8080/ping")
4950
expected := jsonResponse("Could not reach address: notatarget:8080/ping")
5051
h.Check(expected, actual)
5152
})

0 commit comments

Comments
 (0)