Skip to content

Commit

Permalink
Encode user input for uuid command
Browse files Browse the repository at this point in the history
Fixes #315
  • Loading branch information
rtm516 committed Jul 25, 2024
1 parent d1e7800 commit 03ae8a8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import org.json.JSONObject;
import pw.chew.chewbotcca.util.RestClient;

import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.UUID;

Expand All @@ -58,7 +60,7 @@ protected void execute(SlashCommandEvent event) {
EmbedBuilder builder = new EmbedBuilder();
builder.setTitle("Floodgate Player UUID");

RestClient.Response restResponse = RestClient.get("https://api.geysermc.org/v2/xbox/xuid/" + username);
RestClient.Response restResponse = RestClient.get("https://api.geysermc.org/v2/xbox/xuid/" + URLEncoder.encode(username, StandardCharsets.UTF_8));
int serverCode = restResponse.code();
JSONObject response = restResponse.asJSONObject();

Expand Down

0 comments on commit 03ae8a8

Please sign in to comment.