internal/controld: connect to API using ipv4 only

Connecting to API using ipv6 sometimes hang at TLS handshake, using ipv4
only so we can fetch the config more reliably.

Fixed #53
This commit is contained in:
Cuong Manh Le
2023-02-10 00:06:32 +07:00
committed by Cuong Manh Le
parent 3218b5fac1
commit 45f827a2c5
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
const utilityURL = "https://api.controld.com/utility"
@@ -24,7 +25,7 @@ func TestFetchResolverConfig(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
got, err := FetchResolverConfig(tc.uid)
assert.False(t, (err != nil) != tc.wantErr)
require.False(t, (err != nil) != tc.wantErr, err)
if !tc.wantErr {
assert.NotEmpty(t, got.DOH)
}