From c82c231ba7ec7c400e4d48ab943f57a6b29a2a2a Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Thu, 17 Sep 2020 17:23:58 -0600 Subject: caddyhttp: Remove server name from metrics For some reason this breaks automatic HTTP->HTTPS redirects. I am not sure why yet, but as a hotfix remove this until we understand it better. --- modules/caddyhttp/metrics_test.go | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'modules/caddyhttp/metrics_test.go') diff --git a/modules/caddyhttp/metrics_test.go b/modules/caddyhttp/metrics_test.go index 5c3bc1d..14248a3 100644 --- a/modules/caddyhttp/metrics_test.go +++ b/modules/caddyhttp/metrics_test.go @@ -1,7 +1,6 @@ package caddyhttp import ( - "context" "errors" "net/http" "net/http/httptest" @@ -10,20 +9,6 @@ import ( "github.com/prometheus/client_golang/prometheus/testutil" ) -func TestServerNameFromContext(t *testing.T) { - ctx := context.Background() - expected := "UNKNOWN" - if actual := serverNameFromContext(ctx); actual != expected { - t.Errorf("Not equal: expected %q, but got %q", expected, actual) - } - - in := "foo" - ctx = contextWithServerName(ctx, in) - if actual := serverNameFromContext(ctx); actual != in { - t.Errorf("Not equal: expected %q, but got %q", in, actual) - } -} - func TestMetricsInstrumentedHandler(t *testing.T) { handlerErr := errors.New("oh noes") response := []byte("hello world!") -- cgit v1.2.3