提交 24cf06d2 编写于 作者: F fuxiaohei

code style simplify for context package

上级 f988f035
......@@ -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
}
......@@ -72,11 +72,11 @@ func (input *BeegoInput) Site() string {
func (input *BeegoInput) Scheme() string {
if input.Request.URL.Scheme != "" {
return input.Request.URL.Scheme
} else if input.Request.TLS == nil {
}
if input.Request.TLS == nil {
return "http"
} else {
return "https"
}
return "https"
}
// Domain returns host name.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册