mirror of
https://github.com/astaxie/beego.git
synced 2024-11-26 08:01:29 +00:00
This commit is contained in:
parent
904b37032c
commit
e79d756d06
@ -375,16 +375,8 @@ func (c *Controller) CheckXsrfCookie() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Controller) XsrfFormHtml() string {
|
func (c *Controller) XsrfFormHtml() string {
|
||||||
var expire int64
|
|
||||||
if c.XSRFExpire > 0 {
|
|
||||||
expire = int64(c.XSRFExpire)
|
|
||||||
} else {
|
|
||||||
expire = int64(XSRFExpire)
|
|
||||||
}
|
|
||||||
token := GetRandomString(15)
|
|
||||||
c.SetSecureCookie(XSRFKEY, "_xsrf", token, expire)
|
|
||||||
return "<input type=\"hidden\" name=\"_xsrf\" value=\"" +
|
return "<input type=\"hidden\" name=\"_xsrf\" value=\"" +
|
||||||
token + "\"/>"
|
c._xsrf_token + "\"/>"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Controller) GoToFunc(funcname string) {
|
func (c *Controller) GoToFunc(funcname string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user