zh199225 ee7e5ab6a8
修正:XSRFToken函数在特定情况下会产生多个不同Path的_xsrf同名cookie
例如:访问”/login“页面,有个表单,此时会产生一个_xsrf cookie,Path为”/“,此时手动删除_xsrf cookie,Post提交到“/test/post”,会报错expected XSRF not found;后退到”/login“页面,会产生一个Path为”/login“的_xsrf cookie,然后访问"/"根页面,再回到"/login"页面,这时会产生两个_xsrf cookie,Path分别为"/"和”/login",再向"/test/post"页面提交,后端就可能读到错误的_xsrf cookie造成XSRF验证失败。
在XSRFToken函数中,将SetSecureCookie函数中的Path参数固定为"/",可以解决这个问题
2021-08-19 13:08:29 +08:00
2021-08-18 22:46:00 +08:00
2021-07-19 16:30:34 +08:00
fix
2021-08-05 11:13:14 +08:00
2021-06-09 19:42:18 +09:00
2021-01-28 22:28:25 +08:00
2021-06-06 21:05:27 +08:00
2021-06-17 03:36:49 +08:00
2021-08-10 23:27:06 +08:00
2020-12-12 22:30:44 +08:00
2021-08-10 23:27:06 +08:00
2021-08-10 23:27:06 +08:00
2020-12-13 23:09:19 +08:00
2021-06-13 11:28:46 +08:00
2021-01-10 18:25:01 +08:00

Beego Test Go Report Card Go Reference

Beego is used for rapid development of enterprise application in Go, including RESTful APIs, web apps and backend services.

It is inspired by Tornado, Sinatra and Flask. beego has some Go-specific features such as interfaces and struct embedding.

architecture

Beego is composed of four parts:

  1. Base modules: including log module, config module, governor module;
  2. Task: is used for running timed tasks or periodic tasks;
  3. Client: including ORM module, httplib module, cache module;
  4. Server: including web module. We will support gRPC in the future;

Please use RELEASE version, or master branch which contains the latest bug fix

Quick Start

Official website

Example

If you could not open official website, go to beedoc

Web Application

Http Request

Create hello directory, cd hello directory

mkdir hello
cd hello

Init module

go mod init

Download and install

go get github.com/beego/beego/v2@latest
package main

import "github.com/beego/beego/v2/server/web"

func main() {
	web.Run()
}

Build and run

go build hello.go
./hello

Go to http://localhost:8080

Congratulations! You've just built your first beego app.

Features

Modules

Community

License

beego source code is licensed under the Apache Licence, Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0.html).

Description
No description provided
Readme 12 MiB