Merge pull request #2157 from mattermost/ie-cache-fix
Fixing IE expire issue
Этот коммит содержится в:
@@ -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))
|
||||
}
|
||||
|
||||
|
||||
@@ -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()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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()))
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user