mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 00:33:14 +00:00
simplicity
This commit is contained in:
parent
f3c55ba5f2
commit
47597b2b7c
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user