Feat: disable overwrite for non-updating put request, only works under local,slave,OneDrive,OSS policy. (#764)
This commit is contained in:
@@ -34,7 +34,7 @@ func TestHandler_Token(t *testing.T) {
|
||||
},
|
||||
AuthInstance: auth.HMACAuth{},
|
||||
}
|
||||
ctx := context.Background()
|
||||
ctx := context.WithValue(context.Background(), fsctx.DisableOverwrite, true)
|
||||
auth.General = auth.HMACAuth{SecretKey: []byte("test")}
|
||||
|
||||
// 成功
|
||||
@@ -49,6 +49,7 @@ func TestHandler_Token(t *testing.T) {
|
||||
asserts.Equal(true, policy.AutoRename)
|
||||
asserts.Equal("dir", policy.SavePath)
|
||||
asserts.Equal("file", policy.FileName)
|
||||
asserts.Equal("file", policy.FileName)
|
||||
asserts.Equal([]string{"txt"}, policy.AllowedExtension)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user