Skip to content

Commit

Permalink
Fix user agent stripping not working (#707)
Browse files Browse the repository at this point in the history
- Fix Mod Menu build metadata not being properly stripped from the User Agent string generation for privacy
  • Loading branch information
LostLuma authored Apr 22, 2024
1 parent cf58ff0 commit 00fe1ad
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ public static void checkForModrinthUpdates() {
List<String> loaders = ModMenu.runningQuilt ? List.of("fabric", "quilt") : List.of("fabric");

String mcVer = SharedConstants.getGameVersion().getName();
String[] splitVersion = FabricLoader.getInstance().getModContainer(ModMenu.MOD_ID)
.get().getMetadata().getVersion().getFriendlyString().split("\\+", 1); // Strip build metadata for privacy
final var modMenuVersion = splitVersion.length > 1 ? splitVersion[1] : splitVersion[0];
String version = FabricLoader.getInstance().getModContainer(ModMenu.MOD_ID)
.get().getMetadata().getVersion().getFriendlyString();
final var modMenuVersion = version.split("\\+", 2)[0]; // Strip build metadata for privacy
final var userAgent = "%s/%s (%s/%s%s)".formatted(ModMenu.GITHUB_REF, modMenuVersion, mcVer, primaryLoader, environment);

List<UpdateChannel> updateChannels;
Expand Down

0 comments on commit 00fe1ad

Please sign in to comment.