From: Simon THOBY Date: Fri, 5 Jun 2020 16:38:55 +0000 (+0200) Subject: fix the example.yml file: HTTP/2 is shown as HTTP/2.0 in the golang http client ... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=261b0eb586e91646842154a103e6137f1974c4b3;p=blackbox_exporter.git fix the example.yml file: HTTP/2 is shown as HTTP/2.0 in the golang http client (#633) Signed-off-by: Simon Thoby --- diff --git a/example.yml b/example.yml index 3416c74..f36a2a9 100644 --- a/example.yml +++ b/example.yml @@ -3,7 +3,7 @@ modules: prober: http timeout: 5s http: - valid_http_versions: ["HTTP/1.1", "HTTP/2"] + valid_http_versions: ["HTTP/1.1", "HTTP/2.0"] valid_status_codes: [] # Defaults to 2xx method: GET headers: diff --git a/prober/http_test.go b/prober/http_test.go index 29088bf..78f10ca 100644 --- a/prober/http_test.go +++ b/prober/http_test.go @@ -74,8 +74,8 @@ func TestValidHTTPVersion(t *testing.T) { }{ {[]string{}, true}, {[]string{"HTTP/1.1"}, true}, - {[]string{"HTTP/1.1", "HTTP/2"}, true}, - {[]string{"HTTP/2"}, false}, + {[]string{"HTTP/1.1", "HTTP/2.0"}, true}, + {[]string{"HTTP/2.0"}, false}, } for i, test := range tests { ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {