sjqzhang / go-fastdfs

go-fastdfs 是一个简单的分布式文件系统(私有云存储),具有无中心、高性能,高可靠,免维护等优点,支持断点续传,分块上传,小文件合并,自动同步,自动修复。Go-fastdfs is a simple distributed file system (private cloud storage), with no center, high performance, high reliability, maintenance free and other advantages, support breakpoint continuation, block upload, small file merge, automatic synchronization, automatic repair.(similar fastdfs).
https://gitee.com/sjqzhang/go-fastdfs
The Unlicense
3.91k stars 745 forks source link

默认场景default设置secret无效的bug #419

Closed ledccn closed 2 days ago

ledccn commented 1 year ago

bug复现:设置场景列表scenes为default:XXXXXXXXXXXXXXXX,设置enable_google_auth为true。上传文件时scene传递空字符串,场景default设置secret无效!

修复方法,修改http_upload.go文件:

scene = r.FormValue("scene")
code = r.FormValue("code")
if scene == "" {
    //Just for Compatibility
    scene = r.FormValue("scenes")
}
if scene == "" && len(Config().Scenes) != 0 {
    scene = Config().DefaultScene
}
sjqzhang commented 2 days ago

这个是在预期之内的,因为可以同时开启验证与不验证(支持部分场景认证,算是一下特性)。