diff options
author | Petr Ilin <hevav@hevav.dev> | 2022-01-21 19:53:24 +0300 |
---|---|---|
committer | Petr Ilin <hevav@hevav.dev> | 2022-01-21 19:53:24 +0300 |
commit | 21bf2a107e30df944a3523e22016737eb05650cd (patch) | |
tree | 47584f784ae76aced82fe25e733947438fb2f611 /src/main/java | |
parent | cd582dcd5ca096b3e590faed745b6212a44eadcb (diff) | |
download | LimboAuth-21bf2a107e30df944a3523e22016737eb05650cd.tar.gz LimboAuth-21bf2a107e30df944a3523e22016737eb05650cd.tar.bz2 LimboAuth-21bf2a107e30df944a3523e22016737eb05650cd.zip |
URL encoding nickname to allow more characters
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/net/elytrium/limboauth/LimboAuth.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/net/elytrium/limboauth/LimboAuth.java b/src/main/java/net/elytrium/limboauth/LimboAuth.java index 1fc61a4..770dc5b 100644 --- a/src/main/java/net/elytrium/limboauth/LimboAuth.java +++ b/src/main/java/net/elytrium/limboauth/LimboAuth.java @@ -37,9 +37,11 @@ import java.io.File; import java.io.IOException; import java.net.InetAddress; import java.net.URI; +import java.net.URLEncoder; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -400,7 +402,7 @@ public class LimboAuth { try { return this.client.send( HttpRequest.newBuilder() - .uri(URI.create(String.format(Settings.IMP.MAIN.ISPREMIUM_AUTH_URL, nickname))) + .uri(URI.create(String.format(Settings.IMP.MAIN.ISPREMIUM_AUTH_URL, URLEncoder.encode(nickname, StandardCharsets.UTF_8)))) .build(), HttpResponse.BodyHandlers.ofString() ).statusCode() == 200; |