Commit 92b51f76 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Improve static file test failures

parent 132309aa
...@@ -311,21 +311,21 @@ func TestAllowedStaticFile(t *testing.T) { ...@@ -311,21 +311,21 @@ func TestAllowedStaticFile(t *testing.T) {
} { } {
resp, err := http.Get(ws.URL + resource) resp, err := http.Get(ws.URL + resource)
if err != nil { if err != nil {
t.Fatal(err) t.Error(err)
} }
defer resp.Body.Close() defer resp.Body.Close()
buf := &bytes.Buffer{} buf := &bytes.Buffer{}
if _, err := io.Copy(buf, resp.Body); err != nil { if _, err := io.Copy(buf, resp.Body); err != nil {
t.Fatal(err) t.Error(err)
} }
if buf.String() != content { if buf.String() != content {
t.Fatalf("GET %q: Expected %q, got %q", resource, content, buf.String()) t.Errorf("GET %q: Expected %q, got %q", resource, content, buf.String())
} }
if resp.StatusCode != 200 { if resp.StatusCode != 200 {
t.Fatalf("GET %q: expected 200, got %d", resource, resp.StatusCode) t.Errorf("GET %q: expected 200, got %d", resource, resp.StatusCode)
} }
if proxied { if proxied {
t.Fatalf("GET %q: should not have made it to backend", resource) t.Errorf("GET %q: should not have made it to backend", resource)
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment