mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 13:30:56 +00:00
code style simplify for context package
This commit is contained in:
parent
f988f035e5
commit
24cf06d288
@ -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 {
|
||||
return "http"
|
||||
} else {
|
||||
return "https"
|
||||
}
|
||||
if input.Request.TLS == nil {
|
||||
return "http"
|
||||
}
|
||||
return "https"
|
||||
}
|
||||
|
||||
// Domain returns host name.
|
||||
|
Loading…
Reference in New Issue
Block a user