From 2d78f8d058c07d0cd5a38cb72594aab6eca14210 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Fri, 5 Oct 2018 08:58:38 +0200 Subject: [PATCH] Fix TestPutAndGetCLI failing for Go 1.5 It failed because it doesn't include the Content-Type header for every response. --- server_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server_test.go b/server_test.go index e5d9ab3..7727f0c 100644 --- a/server_test.go +++ b/server_test.go @@ -1149,8 +1149,8 @@ func TestPutAndGetCLI(t *testing.T) { mux.ServeHTTP(w, req) contentType := w.Header().Get("Content-Type") - if !strings.HasPrefix(contentType, "text/html") { - t.Fatalf("Didn't receive file display page but %v", w) + if strings.HasPrefix(contentType, "text/plain") { + t.Fatalf("Didn't receive file display page but %s", contentType) } // request file with wget user agent @@ -1163,7 +1163,7 @@ func TestPutAndGetCLI(t *testing.T) { mux.ServeHTTP(w, req) contentType = w.Header().Get("Content-Type") - if strings.HasPrefix(contentType, "text/html") { + if !strings.HasPrefix(contentType, "text/plain") { t.Fatalf("Didn't receive file directly but %s", contentType) }