Skip to content

Commit f323a9f

Browse files
committed
fix: urlencode version in RenameFilename
As per Mircea's comment on [#44 (comment)](#44 (comment)): I've also now noticed that RenameVersion is also not correctly escaping the filename, it's only escaping the mod's name, and not the version, which is what causes mods that use build metadata in the version (+build.1234) to fail, so that one should need a similar fix of encoding the filename. Signed-off-by: Angel Pons <[email protected]>
1 parent 1522bf3 commit f323a9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

storage/storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ func RenameVersion(ctx context.Context, modID string, name string, versionID str
276276
return false, ""
277277
}
278278

279-
return true, fmt.Sprintf("/mods/%s/%s.smod", modID, EncodeName(cleanName)+"-"+version)
279+
return true, fmt.Sprintf("/mods/%s/%s.smod", modID, EncodeName(cleanName+"-"+version))
280280
}
281281

282282
func DeleteMod(ctx context.Context, modID string, name string, versionID string) bool {

0 commit comments

Comments
 (0)