summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/user.go2
-rw-r--r--api/user_test.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/api/user.go b/api/user.go
index d95d775e4..1ca46bd56 100644
--- a/api/user.go
+++ b/api/user.go
@@ -571,10 +571,10 @@ func getProfileImage(c *Context, w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "max-age=300, public") // 5 mins
} else {
w.Header().Set("Cache-Control", "max-age=86400, public") // 24 hrs
+ w.Header().Set(model.HEADER_ETAG_SERVER, etag)
}
w.Header().Set("Content-Type", "image/png")
- w.Header().Set(model.HEADER_ETAG_SERVER, etag)
w.Write(img)
}
}
diff --git a/api/user_test.go b/api/user_test.go
index 44ee1bfb0..5b6309bcf 100644
--- a/api/user_test.go
+++ b/api/user_test.go
@@ -684,8 +684,8 @@ func TestUserCreateImage(t *testing.T) {
} else {
etag := resp.Header.Get(model.HEADER_ETAG_SERVER)
resp2, _ := Client.DoApiGet("/users/"+user.Id+"/image", "", etag)
- if resp2.StatusCode != 304 {
- t.Fatal("Should have hit etag")
+ if resp2.StatusCode == 304 {
+ t.Fatal("Shouldn't have hit etag")
}
}