mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fixing browser version checking. (#4493)
This commit is contained in:
committed by
Harrison Healey
parent
707b01e1ab
commit
a12120eda5
@@ -52,7 +52,6 @@ func CheckBrowserCompatability(c *api.Context, r *http.Request) bool {
|
||||
version := strings.Split(browser, "/")
|
||||
|
||||
if strings.HasPrefix(bname, version[0]) && strings.HasPrefix(bversion, version[1]) {
|
||||
c.Err = model.NewLocAppError("CheckBrowserCompatability", "web.check_browser_compatibility.app_error", nil, "")
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -63,6 +62,9 @@ func CheckBrowserCompatability(c *api.Context, r *http.Request) bool {
|
||||
|
||||
func root(c *api.Context, w http.ResponseWriter, r *http.Request) {
|
||||
if !CheckBrowserCompatability(c, r) {
|
||||
w.Header().Set("Cache-Control", "no-store")
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
w.Write([]byte(c.T("web.check_browser_compatibility.app_error")))
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user