Modify: FileName header in remote put request should be urlencoded

This commit is contained in:
HFO4
2020-01-13 09:47:04 +08:00
parent 4b6fbc0de2
commit 6b6bfb4c6b
2 changed files with 11 additions and 6 deletions

View File

@ -67,11 +67,6 @@ func GetPolicyByID(ID interface{}) (Policy, error) {
return policy, result.Error
}
// IsDirectlyPreview 返回此策略下文件是否可以直接预览(不需要重定向)
func (policy *Policy) IsDirectlyPreview() bool {
return policy.Type == "local"
}
// AfterFind 找到存储策略后的钩子
func (policy *Policy) AfterFind() (err error) {
// 解析存储策略设置到OptionsSerialized
@ -147,3 +142,8 @@ func (policy *Policy) GenerateFileName(uid uint, origin string) string {
fileRule = util.Replace(replaceTable, fileRule)
return fileRule
}
// IsDirectlyPreview 返回此策略下文件是否可以直接预览(不需要重定向)
func (policy *Policy) IsDirectlyPreview() bool {
return policy.Type == "local"
}