code style simplify for context package

This commit is contained in:
fuxiaohei
2015-02-23 11:15:55 +08:00
parent f988f035e5
commit 24cf06d288
2 changed files with 8 additions and 5 deletions

View File

@@ -155,8 +155,11 @@ func (ctx *Context) CheckXsrfCookie() bool {
}
if token == "" {
ctx.Abort(403, "'_xsrf' argument missing from POST")
} else if ctx._xsrf_token != token {
return false
}
if ctx._xsrf_token != token {
ctx.Abort(403, "XSRF cookie does not match POST argument")
return false
}
return true
}