simplicity
This commit is contained in:
parent
f3c55ba5f2
commit
47597b2b7c
1 changed files with 1 additions and 5 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue