[MC-2140] Connecting to a server with a space in the name fails Created: 03/Nov/12 Updated: 18/Aug/21 Resolved: 27/Sep/19 |
|
| Status: | Resolved |
| Project: | Minecraft: Java Edition |
| Component/s: | None |
| Affects Version/s: | Minecraft 1.4.2, Minecraft 1.5, Minecraft 1.5.2, Minecraft 1.6.2, Minecraft 1.7.4, Minecraft 14w08a, Minecraft 1.8, Minecraft 1.8.1-pre3, Minecraft 1.8.8, Minecraft 15w49b, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w42a, Minecraft 16w43a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w50a, Minecraft 1.13, Minecraft 18w31a, Minecraft 18w32a, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 19w03b, Minecraft 19w03c |
| Fix Version/s: | 19w39a |
| Type: | Bug | ||
| Reporter: | Tom Powell | Assignee: | [Mojang] slicedlime |
| Resolution: | Fixed | Votes: | 14 |
| Labels: | None | ||
| CHK: | |
| Confirmation Status: | Confirmed |
| Category: |
UI
|
| Mojang Priority: | Low |
| Description |
| Comments |
| Comment by Kraif [ 24/Aug/18 ] |
|
Confirmed for 1.13.1.
|
| Comment by [Mod] bemoty [ 11/Aug/17 ] |
|
Can confirm for MC 1.12.1. FaRo1, when you type in " google.com" in the URL bar of your web browser, your browser won't tell you that the URL is invalid because it omits trailing and leading whitespaces by default. It does that because there are people out there in the vastness of the internet who are very good at making typos. Since whitespaces are invisible, those people probably wouldn't notice it when there was a whitespace at the beginning or at the end of the URL they just typed in and would very likely complain why they can't reach that URL. The same goes for Minecraft servers. Kumasasa's quote is very fitting here.
|
| Comment by Fabian Röling [ 26/Jun/16 ] |
|
For me it says "Unknown host", which is correct, because there's no server named " localhost". Where is the bug? |
| Comment by null (Inactive) [ 23/Jun/16 ] |
|
Confirmed for 1.10.2. " localhost" results in "cannot resolve hostname" instead of "can't connect to server". |
| Comment by Oliver Kruse [ 21/Feb/14 ] |
|
Confirmed in 14w08a. You may also mention that you are able to add a server to the server list with address " " and nothing more. |
| Comment by Sebastien How [ 25/Jul/13 ] |
|
Version 1.6.2 is still affected by white space pre or post pended to the server address will prevent it from finding the server. |
| Comment by Tom Powell [ 15/Mar/13 ] |
|
Tested on 1.5, still effected (" x.nerd.nu" failed to connect, "x.nerd.nu" is fine). Thanks for the reminder! |
| Comment by Tails [ 15/Mar/13 ] |
|
Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases. |
| Comment by Nuxas [ 05/Mar/13 ] |
|
How about showing a warning dialog that informs the user that there is leading space in the address and tell them to remove it</irony> |
| Comment by Florian Lasinger [ 24/Dec/12 ] |
|
In any case just trim the String. It's very easy to get a surplus whitespace in when copying an address out of a web browser. Further checking can be very tricky due to IDNA. |
| Comment by Kumasasa [ 16/Nov/12 ] |
|
But don't forget Darwin:
|
| Comment by Mark Allan [ 16/Nov/12 ] |
|
Its not truly a bug, but could easily be rectified by removing all spaces from the server name string before attempting to connect. Removing the spaces should have no adverse affects as a server name can't have a space in it anyway. Remember, bug fixes aren't always the result of bugs, sometimes they are just idiot proofing. |
| Comment by DrBreakalot [ 06/Nov/12 ] |
|
How is this a bug? " server.spaceribs.com" doesn't exist, so it should not be found. |
| Comment by Chalmes (Jon) [ 04/Nov/12 ] |
|
Confirmed: Perhaps some whitespace stripping and some regular expressions to validate the entry as valid IP/hostname: ValidIpAddressRegex = "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$";
ValidHostnameRegex = "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$";
|