mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-09-19 12:16:24 +08:00
fix(strm): encoded path is ineffective (#951)
This commit is contained in:
@ -127,20 +127,16 @@ func (d *Strm) list(ctx context.Context, dst, sub string, args *fs.ListArgs) ([]
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *Strm) getLink(ctx context.Context, path string) string {
|
func (d *Strm) getLink(ctx context.Context, path string) string {
|
||||||
var encodePath string
|
finalPath := path
|
||||||
if d.EncodePath {
|
if d.EncodePath {
|
||||||
encodePath = utils.EncodePath(path, true)
|
finalPath = utils.EncodePath(path, true)
|
||||||
}
|
}
|
||||||
if d.EnableSign {
|
if d.EnableSign {
|
||||||
signPath := sign.Sign(path)
|
signPath := sign.Sign(path)
|
||||||
if len(encodePath) > 0 {
|
finalPath = fmt.Sprintf("%s?sign=%s", finalPath, signPath)
|
||||||
path = fmt.Sprintf("%s?sign=%s", encodePath, signPath)
|
|
||||||
} else {
|
|
||||||
path = fmt.Sprintf("%s?sign=%s", path, signPath)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if d.LocalModel {
|
if d.LocalModel {
|
||||||
return path
|
return finalPath
|
||||||
}
|
}
|
||||||
apiUrl := d.SiteUrl
|
apiUrl := d.SiteUrl
|
||||||
if len(apiUrl) > 0 {
|
if len(apiUrl) > 0 {
|
||||||
@ -151,5 +147,5 @@ func (d *Strm) getLink(ctx context.Context, path string) string {
|
|||||||
|
|
||||||
return fmt.Sprintf("%s/d%s",
|
return fmt.Sprintf("%s/d%s",
|
||||||
apiUrl,
|
apiUrl,
|
||||||
path)
|
finalPath)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user