Fixing profile image tag (#7435)
* Fixing profile image tag * Fixing unit test * Fixing unit test
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
0643bf5159
Коммит
99b7d65504
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user