mirror of
https://github.com/xfl03/MCCustomSkinLoader.git
synced 2026-11-19 00:19:16 +00:00
Escape URLs, for usernames with spaces (#100)
This commit is contained in:
1 parent
d7f207177c
commit
46bccadca2
1 file changed
+11
-1
@@ -115,7 +115,17 @@ public class HttpRequestUtil {
|
||||
}
|
||||
|
||||
//Init Connection
|
||||
String url = new URI(request.url).toASCIIString();
|
||||
URL rawUrl = new URL(request.url);
|
||||
URI uri = new URI(
|
||||
rawUrl.getProtocol(),
|
||||
rawUrl.getUserInfo(),
|
||||
rawUrl.getHost(),
|
||||
rawUrl.getPort(),
|
||||
rawUrl.getPath(),
|
||||
rawUrl.getQuery(),
|
||||
rawUrl.getRef()
|
||||
);
|
||||
String url = uri.toASCIIString();
|
||||
if (!url.equalsIgnoreCase(request.url))
|
||||
CustomSkinLoader.logger.debug("Encoded URL: " + url);
|
||||
HttpURLConnection c = (HttpURLConnection) (new URL(url)).openConnection();
|
||||
|
||||
Reference in new issue
Block a user