simplicity

This commit is contained in:
Nazar Kanaev 2021-03-17 16:29:31 +00:00
parent f3c55ba5f2
commit 47597b2b7c

View File

@ -33,11 +33,7 @@ func (m *authMiddleware) handler(c *router.Context) {
rootUrl := m.basepath + "/" rootUrl := m.basepath + "/"
if c.Req.URL.Path != rootUrl { if c.Req.URL.Path != rootUrl {
if unsafeMethod(c.Req.Method) && c.Req.Header.Get("X-Requested-By") != "yarr" { c.Out.WriteHeader(http.StatusUnauthorized)
c.Out.WriteHeader(http.StatusUnauthorized)
return
}
c.Redirect(rootUrl)
return return
} }