From 9eda707297a3bfe84e0c58d58c751041b3b67076 Mon Sep 17 00:00:00 2001 From: Ming Deng Date: Sat, 12 Dec 2020 22:04:26 +0800 Subject: [PATCH 1/2] update doc --- README.md | 23 +++++------------------ build_info.go | 2 +- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 446ad15b..257e7abd 100644 --- a/README.md +++ b/README.md @@ -4,29 +4,18 @@ beego is used for rapid development of RESTful APIs, web apps and backend services in Go. It is inspired by Tornado, Sinatra and Flask. beego has some Go-specific features such as interfaces and struct embedding. -###### More info at [beego.me](http://beego.me). +[Officail website](http://beego.me) +[Example](https://github.com/beego-dev/beego-example) -> If you could not open this website, go to [beedoc](https://github.com/beego/beedoc) +> If you could not open official website, go to [beedoc](https://github.com/beego/beedoc) ## beego 1.x and 2.x -We recently release beego 2.0.0-beta, and its structure change a lot, so you may get some error - 1. If you are working on beego v1.x please try `go get github.com/astaxie/beego@v1.12.3` -2. If you want to try beego 2.0.0, run `go get github.com/astaxie/beego@develop` - -We are still working on fix bug and documentation of v2.x. And v2.x's doc will be released with v2.0.0. - -## Next version - -v1.12.4 will be released on Jan 2021 And v2.0.0 will be released next month. +2. If you want to try beego 2.0.0, run `go get github.com/astaxie/beego@v2.0.0` ## Quick Start -###### Please see [Documentation](http://beego.me/docs) for more. - -###### [beego-example](https://github.com/beego-dev/beego-example) - ### Web Application #### Create `hello` directory, cd `hello` directory @@ -40,9 +29,7 @@ v1.12.4 will be released on Jan 2021 And v2.0.0 will be released next month. #### Download and install - go get -u github.com/astaxie/beego@develop - -Now we are working on beego v2.0.0, so using `@develop`. + go get github.com/astaxie/beego@v2.0.0 #### Create file `hello.go` ```go diff --git a/build_info.go b/build_info.go index 42f42c28..23f74b53 100644 --- a/build_info.go +++ b/build_info.go @@ -28,5 +28,5 @@ var ( const ( // VERSION represent beego web framework version. - VERSION = "2.0.0-alpha" + VERSION = "2.0.0" ) From aec5f4b3a5d433092bc072b9b889f6697b4050a2 Mon Sep 17 00:00:00 2001 From: Ming Deng Date: Sat, 12 Dec 2020 23:24:39 +0800 Subject: [PATCH 2/2] remove flag of XSRF cookie --- server/web/context/context.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/web/context/context.go b/server/web/context/context.go index 53ed3d01..930c14a4 100644 --- a/server/web/context/context.go +++ b/server/web/context/context.go @@ -149,7 +149,8 @@ func (ctx *Context) XSRFToken(key string, expire int64) string { token, ok := ctx.GetSecureCookie(key, "_xsrf") if !ok { token = string(utils.RandomCreateBytes(32)) - ctx.SetSecureCookie(key, "_xsrf", token, expire, "", "", true, true) + // TODO make it configurable + ctx.SetSecureCookie(key, "_xsrf", token, expire, "", "") } ctx._xsrfToken = token }