summaryrefslogtreecommitdiffstats
path: root/api/user_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-01-03 09:56:30 -0500
committerenahum <nahumhbl@gmail.com>2017-01-03 11:56:30 -0300
commit4bca74d5c1e425b0975a52ee06cee69c85232ced (patch)
treeb63fa8f88399c8e228e85ac72ba8c2988784c5e3 /api/user_test.go
parent42e04d92c47dd7226b7e28e396f8d8d6f36e053b (diff)
downloadchat-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.go10
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