mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-25 06:44:03 +08:00
feat(cloudreve): auto remove trailing slash in address (#4492)
Co-authored-by: Andy Hsu <i@nn.ci>
This commit is contained in:
parent
4369cbbac3
commit
a80e21997c
@ -5,6 +5,7 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/alist-org/alist/v3/drivers/base"
|
||||
"github.com/alist-org/alist/v3/internal/driver"
|
||||
@ -30,6 +31,8 @@ func (d *Cloudreve) Init(ctx context.Context) error {
|
||||
if d.Cookie != "" {
|
||||
return nil
|
||||
}
|
||||
// removing trailing slash
|
||||
d.Address = strings.TrimSuffix(d.Address, "/")
|
||||
return d.login()
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ func (d *Cloudreve) request(method string, path string, callback base.ReqCallbac
|
||||
return d.request(method, path, callback, out)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return errors.New(r.Msg)
|
||||
}
|
||||
sess := cookie.GetCookie(resp.Cookies(), "cloudreve-session")
|
||||
|
Loading…
x
Reference in New Issue
Block a user