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