Browse Source

Fix TestPutAndGetCLI failing for Go 1.5

It failed because it doesn't include the Content-Type header for every
response.
pull/145/head
Thor77 6 years ago
parent
commit
2d78f8d058
  1. 6
      server_test.go

6
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)
}

Loading…
Cancel
Save