[MM-16677] New unsupported browser page (#11858)
* Added OSVersion to unsupported browser template (and some test code) * [MM-17569] Working prototype (not functional) of unsupported browser page * WIP * WIP * [MM-17571] Unsupported browser page template logic * WIP * [MM-17572][MM-17573] Added browsers and tested for unsupported under IE and Safari * Clean-up * Added missing license header * Fixed a test * Blank commit to force CI update * PR feedback * oops
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e71b99d9f6
Коммит
9562917734
@@ -44,15 +44,16 @@ func New(config configservice.ConfigService, globalOptions app.AppOptionCreator,
|
||||
// Due to the complexities of UA detection and the ramifications of a misdetection
|
||||
// only older Safari and IE browsers throw incompatibility errors.
|
||||
// Map should be of minimum required browser version.
|
||||
// -1 means that the browser is not supported in any version.
|
||||
var browserMinimumSupported = map[string]int{
|
||||
"BrowserIE": 11,
|
||||
"BrowserIE": 12,
|
||||
"BrowserSafari": 9,
|
||||
}
|
||||
|
||||
func CheckClientCompatability(agentString string) bool {
|
||||
ua := uasurfer.Parse(agentString)
|
||||
|
||||
if version, exist := browserMinimumSupported[ua.Browser.Name.String()]; exist && ua.Browser.Version.Major < version {
|
||||
if version, exist := browserMinimumSupported[ua.Browser.Name.String()]; exist && (ua.Browser.Version.Major < version || version < 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user