diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/file.go | 1 | ||||
-rw-r--r-- | api/post_test.go | 4 | ||||
-rw-r--r-- | api/team.go | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/api/file.go b/api/file.go index 50482a057..800c512c5 100644 --- a/api/file.go +++ b/api/file.go @@ -347,6 +347,7 @@ func getFile(c *Context, w http.ResponseWriter, r *http.Request) { } w.Header().Set("Cache-Control", "max-age=2592000, public") + w.Header().Set("Content-Length", strconv.Itoa(len(f))) w.Write(f) } diff --git a/api/post_test.go b/api/post_test.go index ac9adf358..85d92de3a 100644 --- a/api/post_test.go +++ b/api/post_test.go @@ -331,7 +331,7 @@ func TestGetPosts(t *testing.T) { t.Fatal("wrong order") } - if len(r1.Posts) != 4 { + if len(r1.Posts) != 2 { // 3a1 and 3; 3a1's parent already there t.Fatal("wrong size") } @@ -345,7 +345,7 @@ func TestGetPosts(t *testing.T) { t.Fatal("wrong order") } - if len(r2.Posts) != 4 { + if len(r2.Posts) != 3 { // 2 and 1a1; + 1a1's parent t.Log(r2.Posts) t.Fatal("wrong size") } diff --git a/api/team.go b/api/team.go index d123b7dfa..e34b3a610 100644 --- a/api/team.go +++ b/api/team.go @@ -268,7 +268,7 @@ func createTeam(c *Context, w http.ResponseWriter, r *http.Request) { rteam := result.Data.(*model.Team) if _, err := CreateDefaultChannels(c, rteam.Id); err != nil { - c.Err = nil + c.Err = err return } |