Skip to content

Commit

Permalink
fix: urlencode version in RenameFilename
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Th3Fanbus committed Mar 6, 2024
1 parent 1522bf3 commit f323a9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f323a9f

Please sign in to comment.