fix: cannot use LAN OSS endpoint for uploading
This commit is contained in:
parent
a3d0291f41
commit
c62e355345
3 changed files with 11 additions and 1 deletions
2
assets
2
assets
|
@ -1 +1 @@
|
|||
Subproject commit 1daecbfe7e33a0fa0dd822594432dcba790447f5
|
||||
Subproject commit c4a7dfea2c05077e6e7c7042c8598886bf6f5531
|
|
@ -408,6 +408,10 @@ func (handler *Driver) signSourceURL(ctx context.Context, path string, ttl int64
|
|||
|
||||
// Token 获取上传策略和认证Token
|
||||
func (handler *Driver) Token(ctx context.Context, ttl int64, uploadSession *serializer.UploadSession, file fsctx.FileHeader) (*serializer.UploadCredential, error) {
|
||||
// 初始化客户端
|
||||
if err := handler.InitOSSClient(true); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 生成回调地址
|
||||
siteURL := model.GetSiteURL()
|
||||
|
|
|
@ -320,6 +320,12 @@ func TestFileSystem_CreateDirectory(t *testing.T) {
|
|||
_, err = fs.CreateDirectory(ctx, "/")
|
||||
asserts.NoError(err)
|
||||
asserts.NoError(mock.ExpectationsWereMet())
|
||||
|
||||
// 直接创建根目录, 重设根目录
|
||||
fs.Root = &model.Folder{}
|
||||
_, err = fs.CreateDirectory(ctx, "/")
|
||||
asserts.NoError(err)
|
||||
asserts.NoError(mock.ExpectationsWereMet())
|
||||
}
|
||||
|
||||
func TestFileSystem_ListDeleteFiles(t *testing.T) {
|
||||
|
|
Loading…
Reference in a new issue