Skip to content

Commit 05ff790

Browse files
fix(strm): encoded path is ineffective (#951)
1 parent a703b73 commit 05ff790

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

drivers/strm/util.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,20 +127,16 @@ func (d *Strm) list(ctx context.Context, dst, sub string, args *fs.ListArgs) ([]
127127
}
128128

129129
func (d *Strm) getLink(ctx context.Context, path string) string {
130-
var encodePath string
130+
finalPath := path
131131
if d.EncodePath {
132-
encodePath = utils.EncodePath(path, true)
132+
finalPath = utils.EncodePath(path, true)
133133
}
134134
if d.EnableSign {
135135
signPath := sign.Sign(path)
136-
if len(encodePath) > 0 {
137-
path = fmt.Sprintf("%s?sign=%s", encodePath, signPath)
138-
} else {
139-
path = fmt.Sprintf("%s?sign=%s", path, signPath)
140-
}
136+
finalPath = fmt.Sprintf("%s?sign=%s", finalPath, signPath)
141137
}
142138
if d.LocalModel {
143-
return path
139+
return finalPath
144140
}
145141
apiUrl := d.SiteUrl
146142
if len(apiUrl) > 0 {
@@ -151,5 +147,5 @@ func (d *Strm) getLink(ctx context.Context, path string) string {
151147

152148
return fmt.Sprintf("%s/d%s",
153149
apiUrl,
154-
path)
150+
finalPath)
155151
}

0 commit comments

Comments
 (0)