Fixing browser version checking. (#4493)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
707b01e1ab
Коммит
a12120eda5
@@ -52,7 +52,6 @@ func CheckBrowserCompatability(c *api.Context, r *http.Request) bool {
|
|||||||
version := strings.Split(browser, "/")
|
version := strings.Split(browser, "/")
|
||||||
|
|
||||||
if strings.HasPrefix(bname, version[0]) && strings.HasPrefix(bversion, version[1]) {
|
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
|
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) {
|
func root(c *api.Context, w http.ResponseWriter, r *http.Request) {
|
||||||
if !CheckBrowserCompatability(c, r) {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user