mirror of https://github.com/Xhofe/alist
fix: remove relative path check
parent
9c91f062b9
commit
fd99c2197b
|
@ -5,7 +5,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/alist-org/alist/v3/internal/driver"
|
"github.com/alist-org/alist/v3/internal/driver"
|
||||||
"github.com/alist-org/alist/v3/internal/errs"
|
|
||||||
"github.com/alist-org/alist/v3/pkg/utils"
|
"github.com/alist-org/alist/v3/pkg/utils"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
@ -24,9 +23,10 @@ func ActualPath(storage driver.Additional, rawPath string) string {
|
||||||
// for path: remove the mount path prefix and join the actual root folder if exists
|
// for path: remove the mount path prefix and join the actual root folder if exists
|
||||||
func GetStorageAndActualPath(rawPath string) (driver.Driver, string, error) {
|
func GetStorageAndActualPath(rawPath string) (driver.Driver, string, error) {
|
||||||
rawPath = utils.StandardizePath(rawPath)
|
rawPath = utils.StandardizePath(rawPath)
|
||||||
if strings.Contains(rawPath, "..") {
|
// why can remove this check? because reqPath has joined the base_path of user, no relative path
|
||||||
return nil, "", errors.WithStack(errs.RelativePath)
|
//if strings.Contains(rawPath, "..") {
|
||||||
}
|
// return nil, "", errors.WithStack(errs.RelativePath)
|
||||||
|
//}
|
||||||
storage := GetBalancedStorage(rawPath)
|
storage := GetBalancedStorage(rawPath)
|
||||||
if storage == nil {
|
if storage == nil {
|
||||||
return nil, "", errors.Errorf("can't find storage with rawPath: %s", rawPath)
|
return nil, "", errors.Errorf("can't find storage with rawPath: %s", rawPath)
|
||||||
|
|
Loading…
Reference in New Issue