summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-02-12 08:06:41 -0500
committerChristopher Speller <crspeller@gmail.com>2016-02-12 08:06:41 -0500
commit0807fe5b05d9febe40442a64d89f2d16a951a26a (patch)
tree91d60f9a8433ad20ae49442ed6c9649a1193eaf5
parent3f50aa473405fe34ec618e0b3618f939d9ba8a99 (diff)
parent35e3b8c40fcec5516f888ed5ba578e3a94f49257 (diff)
downloadchat-0807fe5b05d9febe40442a64d89f2d16a951a26a.tar.gz
chat-0807fe5b05d9febe40442a64d89f2d16a951a26a.tar.bz2
chat-0807fe5b05d9febe40442a64d89f2d16a951a26a.zip
Merge pull request #2157 from mattermost/ie-cache-fix
Fixing IE expire issue
-rw-r--r--api/admin.go1
-rw-r--r--api/channel.go2
-rw-r--r--api/context.go4
-rw-r--r--api/post.go1
-rw-r--r--api/team.go1
-rw-r--r--api/user.go1
6 files changed, 4 insertions, 6 deletions
diff --git a/api/admin.go b/api/admin.go
index 5a645dc97..d04991353 100644
--- a/api/admin.go
+++ b/api/admin.go
@@ -121,7 +121,6 @@ func getConfig(c *Context, w http.ResponseWriter, r *http.Request) {
json = cfg.ToJson()
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
- w.Header().Set("Expires", "0")
w.Write([]byte(json))
}
diff --git a/api/channel.go b/api/channel.go
index ff5b0f8da..e97e08fc0 100644
--- a/api/channel.go
+++ b/api/channel.go
@@ -729,7 +729,6 @@ func getChannel(c *Context, w http.ResponseWriter, r *http.Request) {
return
} else {
w.Header().Set(model.HEADER_ETAG_SERVER, data.Etag())
- w.Header().Set("Expires", "-1")
w.Write([]byte(data.ToJson()))
}
}
@@ -798,7 +797,6 @@ func getChannelExtraInfo(c *Context, w http.ResponseWriter, r *http.Request) {
data := model.ChannelExtra{Id: channel.Id, Members: extraMembers, MemberCount: memberCount}
w.Header().Set(model.HEADER_ETAG_SERVER, extraEtag)
- w.Header().Set("Expires", "-1")
w.Write([]byte(data.ToJson()))
}
}
diff --git a/api/context.go b/api/context.go
index b91981ecd..d0b4f85d2 100644
--- a/api/context.go
+++ b/api/context.go
@@ -165,6 +165,10 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
} else {
// All api response bodies will be JSON formatted by default
w.Header().Set("Content-Type", "application/json")
+
+ if r.Method == "GET" {
+ w.Header().Set("Expires", "0")
+ }
}
if len(token) != 0 {
diff --git a/api/post.go b/api/post.go
index fadabd66e..9d3ba5ab1 100644
--- a/api/post.go
+++ b/api/post.go
@@ -1197,6 +1197,5 @@ func searchPosts(c *Context, w http.ResponseWriter, r *http.Request) {
}
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
- w.Header().Set("Expires", "0")
w.Write([]byte(posts.ToJson()))
}
diff --git a/api/team.go b/api/team.go
index 6d59e94e9..052d6e698 100644
--- a/api/team.go
+++ b/api/team.go
@@ -647,7 +647,6 @@ func getMyTeam(c *Context, w http.ResponseWriter, r *http.Request) {
return
} else {
w.Header().Set(model.HEADER_ETAG_SERVER, result.Data.(*model.Team).Etag())
- w.Header().Set("Expires", "-1")
w.Write([]byte(result.Data.(*model.Team).ToJson()))
return
}
diff --git a/api/user.go b/api/user.go
index db8de5f6a..7919da168 100644
--- a/api/user.go
+++ b/api/user.go
@@ -897,7 +897,6 @@ func getMe(c *Context, w http.ResponseWriter, r *http.Request) {
} else {
result.Data.(*model.User).Sanitize(map[string]bool{})
w.Header().Set(model.HEADER_ETAG_SERVER, result.Data.(*model.User).Etag())
- w.Header().Set("Expires", "-1")
w.Write([]byte(result.Data.(*model.User).ToJson()))
return
}