Skip to content

Commit

Permalink
Fix: endless loop while creating nested folders
Browse files Browse the repository at this point in the history
  • Loading branch information
HFO4 committed Feb 20, 2020
1 parent 4420a75 commit 58d8695
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/filesystem/manage.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ func (fs *FileSystem) listObjects(ctx context.Context, parent string, files []mo

// CreateDirectory 根据给定的完整创建目录,支持递归创建
func (fs *FileSystem) CreateDirectory(ctx context.Context, fullPath string) (*model.Folder, error) {
if fullPath == "/" {
if fullPath == "/" || fullPath == "." || fullPath == "" {
return nil, ErrRootProtected
}

Expand Down
1 change: 1 addition & 0 deletions routers/file_router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func TestLocalFileUpload(t *testing.T) {
)
req.Header.Add("Content-Length", "4")
req.Header.Add("X-FileName", "TestFileUploadRoute.txt")
req.Header.Add("X-Path", "/")
return req
},
ExpectCode: 0,
Expand Down

0 comments on commit 58d8695

Please sign in to comment.