summaryrefslogtreecommitdiffstats
path: root/api/post.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/post.go')
-rw-r--r--api/post.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/api/post.go b/api/post.go
index 28c81b9a5..b6539ed54 100644
--- a/api/post.go
+++ b/api/post.go
@@ -421,13 +421,16 @@ func getFileInfosForPost(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- if infos, err := app.GetFileInfosForPost(postId); err != nil {
+ if infos, err := app.GetFileInfosForPost(postId, false); err != nil {
c.Err = err
return
} else if HandleEtag(model.GetEtagForFileInfos(infos), "Get File Infos For Post", w, r) {
return
} else {
- w.Header().Set("Cache-Control", "max-age=2592000, public")
+ if len(infos) > 0 {
+ w.Header().Set("Cache-Control", "max-age=2592000, public")
+ }
+
w.Header().Set(model.HEADER_ETAG_SERVER, model.GetEtagForFileInfos(infos))
w.Write([]byte(model.FileInfosToJson(infos)))
}