|
|
|
@ -147,7 +147,7 @@ func TestNewHTTPBearerToken(t *testing.T) {
|
|
|
|
|
cfg := config_util.HTTPClientConfig{ |
|
|
|
|
BearerToken: "1234", |
|
|
|
|
} |
|
|
|
|
c, err := config_util.NewClientFromConfig(cfg, "test", false, false) |
|
|
|
|
c, err := config_util.NewClientFromConfig(cfg, "test", config_util.WithHTTP2Disabled()) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Fatal(err) |
|
|
|
|
} |
|
|
|
@ -174,7 +174,7 @@ func TestNewHTTPBearerTokenFile(t *testing.T) {
|
|
|
|
|
cfg := config_util.HTTPClientConfig{ |
|
|
|
|
BearerTokenFile: "testdata/bearertoken.txt", |
|
|
|
|
} |
|
|
|
|
c, err := config_util.NewClientFromConfig(cfg, "test", false, false) |
|
|
|
|
c, err := config_util.NewClientFromConfig(cfg, "test", config_util.WithHTTP2Disabled()) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Fatal(err) |
|
|
|
|
} |
|
|
|
@ -203,7 +203,7 @@ func TestNewHTTPBasicAuth(t *testing.T) {
|
|
|
|
|
Password: "password123", |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
c, err := config_util.NewClientFromConfig(cfg, "test", false, false) |
|
|
|
|
c, err := config_util.NewClientFromConfig(cfg, "test", config_util.WithHTTP2Disabled()) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Fatal(err) |
|
|
|
|
} |
|
|
|
@ -231,7 +231,7 @@ func TestNewHTTPCACert(t *testing.T) {
|
|
|
|
|
CAFile: caCertPath, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
c, err := config_util.NewClientFromConfig(cfg, "test", false, false) |
|
|
|
|
c, err := config_util.NewClientFromConfig(cfg, "test", config_util.WithHTTP2Disabled()) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Fatal(err) |
|
|
|
|
} |
|
|
|
@ -264,7 +264,7 @@ func TestNewHTTPClientCert(t *testing.T) {
|
|
|
|
|
KeyFile: "testdata/client.key", |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
c, err := config_util.NewClientFromConfig(cfg, "test", false, false) |
|
|
|
|
c, err := config_util.NewClientFromConfig(cfg, "test", config_util.WithHTTP2Disabled()) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Fatal(err) |
|
|
|
|
} |
|
|
|
@ -293,7 +293,7 @@ func TestNewHTTPWithServerName(t *testing.T) {
|
|
|
|
|
ServerName: "prometheus.rocks", |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
c, err := config_util.NewClientFromConfig(cfg, "test", false, false) |
|
|
|
|
c, err := config_util.NewClientFromConfig(cfg, "test", config_util.WithHTTP2Disabled()) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Fatal(err) |
|
|
|
|
} |
|
|
|
@ -322,7 +322,7 @@ func TestNewHTTPWithBadServerName(t *testing.T) {
|
|
|
|
|
ServerName: "badname", |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
c, err := config_util.NewClientFromConfig(cfg, "test", false, false) |
|
|
|
|
c, err := config_util.NewClientFromConfig(cfg, "test", config_util.WithHTTP2Disabled()) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Fatal(err) |
|
|
|
|
} |
|
|
|
@ -360,7 +360,7 @@ func TestNewClientWithBadTLSConfig(t *testing.T) {
|
|
|
|
|
KeyFile: "testdata/nonexistent_client.key", |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
_, err := config_util.NewClientFromConfig(cfg, "test", false, false) |
|
|
|
|
_, err := config_util.NewClientFromConfig(cfg, "test", config_util.WithHTTP2Disabled()) |
|
|
|
|
if err == nil { |
|
|
|
|
t.Fatalf("Expected error, got nil.") |
|
|
|
|
} |
|
|
|
|