From f323a9ffacb2cda31cd2e682bf920cdbd35d3908 Mon Sep 17 00:00:00 2001 From: Angel Pons <22937129+Th3Fanbus@users.noreply.github.com> Date: Wed, 6 Mar 2024 07:41:08 +0000 Subject: [PATCH] fix: urlencode version in `RenameFilename` As per Mircea's comment on [#44 (comment)](https://github.com/satisfactorymodding/smr-api/pull/44#issuecomment-1902611988): 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 --- storage/storage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/storage.go b/storage/storage.go index 31aa2323..9c2ec55c 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -276,7 +276,7 @@ func RenameVersion(ctx context.Context, modID string, name string, versionID str return false, "" } - return true, fmt.Sprintf("/mods/%s/%s.smod", modID, EncodeName(cleanName)+"-"+version) + return true, fmt.Sprintf("/mods/%s/%s.smod", modID, EncodeName(cleanName+"-"+version)) } func DeleteMod(ctx context.Context, modID string, name string, versionID string) bool {