beego
Here are 272 public repositories matching this topic...
-
Updated
Oct 10, 2020 - Go
-
Updated
Apr 2, 2019 - Go
-
Updated
Mar 5, 2019 - Go
-
Updated
Aug 30, 2020 - Go
Improve this page
Add a description, image, and links to the beego topic page so that developers can more easily learn about it.
Add this topic to your repo
To associate your repository with the beego topic, visit your repo's landing page and select "manage topics."
描述:
我发现框架会自动在接口路由匹配前将multipart form数据缓存到磁盘中(当大于设定的允许内存读取大小时),并且缓存时是没有对大小进行限制的。该设计可能会导致客户端通过少量请求恶意提交大量数据将服务端磁盘临时占满。
当前处理方式:
增加一个BeforeStatic的过滤器,用于拦截所有携带multipart form数据的请求。不过该场景还是比较通用的,让每个使用beego框架的项目增加这个逻辑会比较冗余。
需求:
能否增加一个配置项用来控制是否由框架自动缓存呢?关闭的情况下,如果接口需要缓存,可以自行在handler中调用parsemultiform方法进行缓存。
相关代码行:
https://github.com/astaxie/beego/blob/f6519b29a846bdf59a2b86baa011c242f78387d5/router.