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,13 +33,9 @@ func (m *authMiddleware) handler(c *router.Context) {
|
||||
rootUrl := m.basepath + "/"
|
||||
|
||||
if c.Req.URL.Path != rootUrl {
|
||||
if unsafeMethod(c.Req.Method) && c.Req.Header.Get("X-Requested-By") != "yarr" {
|
||||
c.Out.WriteHeader(http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
c.Redirect(rootUrl)
|
||||
return
|
||||
}
|
||||
|
||||
if c.Req.Method == "POST" {
|
||||
username := c.Req.FormValue("username")
|
||||
|
Loading…
x
Reference in New Issue
Block a user