1
0
espelhamento de https://github.com/astaxie/beego.git sincronizado 2025-07-17 18:52:16 +00:00

code style simplify for context package

Esse commit está contido em:
fuxiaohei
2015-02-23 11:15:55 +08:00
commit 24cf06d288
2 arquivos alterados com 8 adições e 5 exclusões

Ver arquivo

@@ -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
}

Ver arquivo

@@ -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.