mirror of
https://github.com/cloudreve/Cloudreve.git
synced 2026-11-17 22:58:07 +00:00
Feat: remote upload callback / validation
This commit is contained in:
1 parent
d29b7ef6f8
commit
4a5782b4e5
6 files changed
+61
-8
No files matched your search
@@ -208,7 +208,6 @@ func GenericAfterUpdate(ctx context.Context, fs *FileSystem) error {
|
||||
}
|
||||
|
||||
// SlaveAfterUpload Slave模式下上传完成钩子
|
||||
// TODO 测试
|
||||
func SlaveAfterUpload(ctx context.Context, fs *FileSystem) error {
|
||||
fileHeader := ctx.Value(fsctx.FileHeaderCtx).(FileHeader)
|
||||
policy := ctx.Value(fsctx.UploadPolicyCtx).(serializer.UploadPolicy)
|
||||
@@ -225,6 +224,7 @@ func SlaveAfterUpload(ctx context.Context, fs *FileSystem) error {
|
||||
Name: file.Name,
|
||||
SourceName: file.SourceName,
|
||||
PicInfo: file.PicInfo,
|
||||
Size: fileHeader.GetSize(),
|
||||
}
|
||||
return request.RemoteCallback(policy.CallbackURL, callbackBody)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user