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()
|
json = cfg.ToJson()
|
||||||
|
|
||||||
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||||
w.Header().Set("Expires", "0")
|
|
||||||
w.Write([]byte(json))
|
w.Write([]byte(json))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -729,7 +729,6 @@ func getChannel(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
w.Header().Set(model.HEADER_ETAG_SERVER, data.Etag())
|
w.Header().Set(model.HEADER_ETAG_SERVER, data.Etag())
|
||||||
w.Header().Set("Expires", "-1")
|
|
||||||
w.Write([]byte(data.ToJson()))
|
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}
|
data := model.ChannelExtra{Id: channel.Id, Members: extraMembers, MemberCount: memberCount}
|
||||||
w.Header().Set(model.HEADER_ETAG_SERVER, extraEtag)
|
w.Header().Set(model.HEADER_ETAG_SERVER, extraEtag)
|
||||||
w.Header().Set("Expires", "-1")
|
|
||||||
w.Write([]byte(data.ToJson()))
|
w.Write([]byte(data.ToJson()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,6 +165,10 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
} else {
|
} else {
|
||||||
// All api response bodies will be JSON formatted by default
|
// All api response bodies will be JSON formatted by default
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
|
||||||
|
if r.Method == "GET" {
|
||||||
|
w.Header().Set("Expires", "0")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(token) != 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("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||||
w.Header().Set("Expires", "0")
|
|
||||||
w.Write([]byte(posts.ToJson()))
|
w.Write([]byte(posts.ToJson()))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -647,7 +647,6 @@ func getMyTeam(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
w.Header().Set(model.HEADER_ETAG_SERVER, result.Data.(*model.Team).Etag())
|
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()))
|
w.Write([]byte(result.Data.(*model.Team).ToJson()))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -897,7 +897,6 @@ func getMe(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
} else {
|
} else {
|
||||||
result.Data.(*model.User).Sanitize(map[string]bool{})
|
result.Data.(*model.User).Sanitize(map[string]bool{})
|
||||||
w.Header().Set(model.HEADER_ETAG_SERVER, result.Data.(*model.User).Etag())
|
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()))
|
w.Write([]byte(result.Data.(*model.User).ToJson()))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user