URL Encoding
There are a couple of issues regarding spaces in usernames I've noticed while poking around the client (and I'd guess the server as well). The key one that breaks many http servers is that you don't URLencode the strings, so that, say, "Socks the Fox" gets sent in the headers as this:
GET /MinecraftSkins/Socks the Fox.png HTTP/1.1
Which looks fine until you realize that HTTP servers see a GET for "/MinecraftSkins/Socks" with a protocol version of "the Fox.png HTTP/1.1" It probably also causes issues with servers that don't like unencoded UTF characters in URLs, but I don't think that will be as problematic.
If you'd run the strings through URLencode.encode(x,x) you'd get the proper URL:
GET /MinecraftSkins/Socks+the+Fox.png HTTP/1.1
Combine this with better tokenizing of server commands (i.e. '/give "Socks the Fox" 157') and you'd be able to support spaces in names properly.
Note that the issue also appears in the launcher as well, which breaks updating for users with spaces in their names 'cause it breaks up the requests and ends up asking for nonexistant files.
So basically the fix is as simple as changing all the constructors for URLs from "new URL(string);" to "new URL(URLEncoder.encode(string, "UTF-8"));" which should be almost as easy as Find/Replace. You wanna be HTTP compliant, right? ;P
2013-02-01, 01:29 AM
2013-07-29, 05:37 PM
2013-07-29, 05:37 PM
0
3
Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w04a, Snapshot 13w05a
-