183 Commits

Author SHA1 Message Date
Kota
6f803ec9a9
fix: use of ioutil package (#5261)
* fix ioutil.NopCloser

* fix ioutil.ReadAll

* fix ioutil.ReadFile

* fix ioutil.WriteFile

* run goimports -w -format-only ./

* update CHANGELOG.md
2023-06-25 18:48:23 +08:00
Deng Ming
3673a322a6 closes 5254: %COL% should be a common placeholder 2023-06-20 17:21:40 +08:00
Hanjiang Yu
e04f499f24 Beego web.Run() runs the server twice 2023-06-19 16:15:08 +08:00
Ming Deng
90050194fe
Merge pull request #5236 from testwill/kit-log
chore: Use github.com/go-kit/log
2023-06-08 22:40:36 +08:00
guoguangwu
94724c7f3e fix: golangci-lint error 2023-06-08 15:49:40 +08:00
guoguangwu
954d935ad1 chore: Use github.com/go-kit/log 2023-06-08 13:22:20 +08:00
guoguangwu
e71815cf03 chore: fmt modify 2023-06-08 12:10:16 +08:00
Deng Ming
3e96b23551 httplib: fix unstable test, do not use httplib.org 2023-06-04 14:32:51 +08:00
cui fliter
53d9e8be69
fix some comments (#5194)
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-05-21 13:48:06 +08:00
Stone-afk
0002ad0fb4
bugfix: protect field access with lock to avoid possible data race (#5211) 2023-05-18 21:22:41 +08:00
Xuing
e4cd6b5722
Unified gopkg.in/yaml version to v2 (#5169)
* Unified gopkg.in/yaml version to v2 and go mod tidy

* update CHANGELOG
2023-03-09 15:19:01 +08:00
Stone-afk
8d139b8b29 bugfix Controller SaveToFile remove all temp file 2023-01-16 13:02:54 +08:00
Stone-afk
df32e9e2a8 feature upload remove all temp file 2023-01-16 13:02:54 +08:00
Deng Ming
5ade9fa025 format code 2022-12-23 11:31:00 +08:00
Chlins Zhang
cc5a0258b2
fix: revise the body wrapper to handle empty body case (#5102)
Fix the router.go serverHttp method, wrap the body if the request body
is empty, which can avoid panic when calling the CopyBody method.

Signed-off-by: chlins <chenyuzh@vmware.com>

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-11-22 16:28:00 +08:00
王哈哈
1bb607b286
Modify comment syntax error (#5094) 2022-11-10 18:22:37 +08:00
Ming Deng
ab5a13f02a
fix 5022: Miss assiging ln to graceful Server (#5028) 2022-07-28 22:53:00 +08:00
Deng Ming
bf60d037f2 fix 4907: force admin service http only 2022-07-02 17:04:31 +08:00
dada0z
d696a37f48 bugfix: Csrf token should be Secure and httpOnly, but not now 2022-06-18 19:50:00 +08:00
Deng Ming
41cc57dcf2 fix 4976: make admin serve HTTP only 2022-06-10 21:26:36 +08:00
Deng Ming
79abec4fb9 fix 4975: graceful server listen the specific address 2022-06-10 19:04:09 +08:00
runner361
4ca2780dbf Fix issue 4961
Fix issue 4961, `leafInfo.match()` use `path.join()` to deal with `wildcardValues`, which may lead to cross directory risk
2022-05-29 07:54:48 +08:00
runner361
64cf44d725
fix issue 4946 (#4954)
* Update tree.go

fix issue 4946 CVE-2022-31259
2022-05-23 18:15:13 +08:00
luyanbo
01880adad1 add callback 2022-04-29 11:45:50 +08:00
Deng Ming
9081c40eaa Merge branch 'master' of github.com:beego/beego into dev 2022-01-28 00:12:47 +08:00
Deng Ming
3e886f71ca replace beego.me with beego.vip 2021-11-29 21:29:29 +08:00
Deng Ming
0347cfc7a5 fxi4782: must set status before rendering error page 2021-10-20 20:43:17 +08:00
Deng Ming
3981234bfb set default rate and capacity for ratelimit filter 2021-10-19 22:31:15 +08:00
Ming Deng
4437c6eb11 merge master 2021-09-03 11:40:13 +08:00
zh199225
326fea768a
Always set a default value "/" for Cookie "Path"
When the URL is end with "/", and the parameter "Path" of SetCookie() Function is "", the "Path" of cookie that set in browser will not be the default value "/"., I think it's incorrect. When the URL is not end with "/", it's correct.
2021-08-20 09:23:03 +08:00
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
Ming Deng
e37e84b3d7 Fix 4727: CSS when the request URI is invalid 2021-08-17 00:36:42 +08:00
Ming Deng
e7d91a2bed Refator:
1. Move BindXXX core logic to context.Context for two reasons:
   1.1 Controller should be stateless -- Due to historical reason, it's hard for us to do this but we should try it
   1.2 If users didn't use Controller to write their functions, they should be allowed to use those methods
2. Move XXXResp to context.Context
2021-08-10 23:27:06 +08:00
Ming Deng
9ce8aa734a Add change log 2021-08-04 22:59:04 +08:00
Ming Deng
32d7633a04 Rename RouterXXX to CtrlXXX 2021-08-04 21:47:47 +08:00
Ming Deng
c6b001d16e Add comments for BConfig 2021-08-02 00:01:48 +08:00
Ming Deng
a91aa0e966
Merge pull request #4679 from xjl662750/develop
add SameSite for Cookie
2021-07-24 21:18:43 +08:00
xjl
86b0a3ba3f add unit test cases 2021-07-22 16:18:20 +08:00
such
005b8b5813 fix comment
change MainContorlller to MainController
2021-07-19 16:30:34 +08:00
lowitea
1378006d51
Fixes CustomAbort
Always set the response status in the CustomAbort function
2021-07-01 16:28:36 +03:00
xjl662750
4fa797feaa
Update output.go
add SameSite for Cookie
2021-06-29 09:31:50 +08:00
Ming Deng
fea7c914cc
Merge pull request #4607 from jimashi/develop
add template functions eq,lt to support uint and int compare.
2021-06-26 00:15:46 +08:00
letu
92b520d810 provided template function eq,lt unit test. 2021-06-25 00:51:55 +08:00
loyalsoldier
007952f7fe
Fix: refine tests 2021-06-18 00:51:00 +08:00
loyalsoldier
87158d6c3f
Fix: avoid shadow of builtin 2021-06-17 03:36:48 +08:00
letu
99b7c0bae4 Merge remote-tracking branch 'origin/develop' into develop 2021-06-16 23:21:45 +08:00
letu
a4e1860659 provided template function eq,lt unit test. 2021-06-16 23:18:07 +08:00
Ming Deng
13508f2840
Merge branch 'develop' into develop 2021-06-16 22:19:00 +08:00
Ikko Ashimine
a1d6c1bc18
Fix typo in templatefunc.go
wether -> whether
2021-06-14 11:58:48 +09:00
loyalsoldier
1023f83a92
Fix lint and format code in server dir 2021-06-07 19:03:40 +08:00