mirror of https://github.com/Xhofe/alist
Refactor (storage): Comment out the path validation logic (#9308)
- Comment out the error return logic for paths with "/" - Remove storage path restrictions to allow for flexible handling of root pathspull/7757/merge
parent
4b288a08ef
commit
23107483a1
|
@ -47,9 +47,9 @@ func CreateStorage(ctx context.Context, storage model.Storage) (uint, error) {
|
|||
storage.Modified = time.Now()
|
||||
storage.MountPath = utils.FixAndCleanPath(storage.MountPath)
|
||||
|
||||
if storage.MountPath == "/" {
|
||||
return 0, errors.New("Mount path cannot be '/'")
|
||||
}
|
||||
//if storage.MountPath == "/" {
|
||||
// return 0, errors.New("Mount path cannot be '/'")
|
||||
//}
|
||||
|
||||
var err error
|
||||
// check driver first
|
||||
|
@ -210,9 +210,9 @@ func UpdateStorage(ctx context.Context, storage model.Storage) error {
|
|||
}
|
||||
storage.Modified = time.Now()
|
||||
storage.MountPath = utils.FixAndCleanPath(storage.MountPath)
|
||||
if storage.MountPath == "/" {
|
||||
return errors.New("Mount path cannot be '/'")
|
||||
}
|
||||
//if storage.MountPath == "/" {
|
||||
// return errors.New("Mount path cannot be '/'")
|
||||
//}
|
||||
err = db.UpdateStorage(&storage)
|
||||
if err != nil {
|
||||
return errors.WithMessage(err, "failed update storage in database")
|
||||
|
|
Loading…
Reference in New Issue