sjqzhang/go-fastdfs

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

ledccn opened this issue · 1 comments

ledccn commented

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
}