mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-07 17:02:29 +01:00
fix (IE): block IE to avoid a shitty experience of their platform
This commit is contained in:
parent
787660f680
commit
fc0189a2c0
1 changed files with 9 additions and 5 deletions
|
|
@ -43,15 +43,19 @@ func IndexHandler(_path string) func(App, http.ResponseWriter, *http.Request) {
|
||||||
res.WriteHeader(http.StatusNotFound)
|
res.WriteHeader(http.StatusNotFound)
|
||||||
res.Write([]byte(Page("<h1>404 - Not Found</h1>")))
|
res.Write([]byte(Page("<h1>404 - Not Found</h1>")))
|
||||||
return
|
return
|
||||||
} else if ua := req.Header.Get("User-Agent"); strings.Contains(ua, "MSIE ") {
|
}
|
||||||
res.WriteHeader(http.StatusBadRequest)
|
ua := req.Header.Get("User-Agent");
|
||||||
|
if strings.Contains(ua, "MSIE ") || strings.Contains(ua, "Edge/"){
|
||||||
|
// Microsoft is behaving on many occasion differently than Firefox / Chrome.
|
||||||
|
// I have neither the time / motivation for it to work properly
|
||||||
|
res.WriteHeader(http.StatusBadRequest)
|
||||||
res.Write([]byte(
|
res.Write([]byte(
|
||||||
Page(`
|
Page(`
|
||||||
<h1>Internet explorer is not yet supported</h1>
|
<h1>Internet explorer is not supported</h1>
|
||||||
<p>
|
<p>
|
||||||
To provide the best possible experience for everyone else, we don't support IE at this time.
|
We don't support IE / Edge at this time
|
||||||
<br>
|
<br>
|
||||||
Use either Chromium, Firefox or Chrome
|
Please use either Chromium, Firefox or Chrome
|
||||||
</p>
|
</p>
|
||||||
`)))
|
`)))
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue