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.
  • Loading branch information
Th3Fanbus authored Mar 6, 2024
1 parent efdeadc commit 953a3d3
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))

Check failure on line 279 in storage/storage.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `gofumpt`-ed (gofumpt)
}

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

0 comments on commit 953a3d3

Please sign in to comment.