working commit
This commit is contained in:
@@ -101,8 +101,6 @@ func (oper *Operator) PutFile(ctx context.Context, param *PutFileParams) (int, *
|
||||
filename := path.Base(xfilepath)
|
||||
collection := path.Dir(xfilepath)
|
||||
|
||||
oper.logg.Debugf("Put file [%s] [%s]", collection, filename)
|
||||
|
||||
tmpname, size, checksum, err := oper.store.WriteTempFile(param.Source)
|
||||
if err != nil {
|
||||
code := http.StatusInternalServerError
|
||||
@@ -178,8 +176,6 @@ func (oper *Operator) GetFile(ctx context.Context, param *GetFileParams) (int, *
|
||||
filename := path.Base(xfilepath)
|
||||
collection := path.Dir(xfilepath)
|
||||
|
||||
oper.logg.Debugf("Get file [%s] [%s]", collection, filename)
|
||||
|
||||
descrExists, fileDescr, err := oper.mdb.GetFileByCollection(ctx, collection, filename)
|
||||
if err != nil {
|
||||
code := http.StatusInternalServerError
|
||||
@@ -259,14 +255,11 @@ func (oper *Operator) ListFiles(ctx context.Context, param *ListFilesParams) (in
|
||||
|
||||
// TODO: convert file path to a unified and secure state
|
||||
|
||||
xfilepath, err := cleanFilepath(param.Filepath)
|
||||
_, err = cleanFilepath(param.Filepath)
|
||||
if err != nil {
|
||||
code := http.StatusInternalServerError
|
||||
return code, res, err
|
||||
}
|
||||
collection := xfilepath
|
||||
|
||||
oper.logg.Debugf("List files by %s", collection)
|
||||
|
||||
fileDescrs, err := oper.mdb.ListAllFiles(ctx)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user