diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-01-03 09:56:30 -0500 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2017-01-03 11:56:30 -0300 |
commit | 4bca74d5c1e425b0975a52ee06cee69c85232ced (patch) | |
tree | b63fa8f88399c8e228e85ac72ba8c2988784c5e3 /api/user_test.go | |
parent | 42e04d92c47dd7226b7e28e396f8d8d6f36e053b (diff) | |
download | chat-4bca74d5c1e425b0975a52ee06cee69c85232ced.tar.gz chat-4bca74d5c1e425b0975a52ee06cee69c85232ced.tar.bz2 chat-4bca74d5c1e425b0975a52ee06cee69c85232ced.zip |
Adding Etag to user profile pictures. (#4926)
Diffstat (limited to 'api/user_test.go')
-rw-r--r-- | api/user_test.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/api/user_test.go b/api/user_test.go index 02589f9d0..c846beee3 100644 --- a/api/user_test.go +++ b/api/user_test.go @@ -712,7 +712,15 @@ func TestUserCreateImage(t *testing.T) { Client.Login(user.Email, "passwd1") - Client.DoApiGet("/users/"+user.Id+"/image", "", "") + if resp, err := Client.DoApiGet("/users/"+user.Id+"/image", "", ""); err != nil { + t.Fatal(err) + } 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 utils.Cfg.FileSettings.DriverName == model.IMAGE_DRIVER_S3 { endpoint := utils.Cfg.FileSettings.AmazonS3Endpoint |