ServerAddressSpaceFix

Mod

Fix the "unknown host" bug when adding a server or connecting directly to a server with a space at the end of the server address

Client Optimization

13.1k downloads
10 followers
Created8 months ago
Updated19 days ago

Follow Save
Host your Minecraft server on BisectHosting - get 25% off your first month with code MODRINTH.

Tip: This description has been translated from the Chinese source text using DeepL, if necessary, it is recommended to view the source text.
如果你能看懂这段文字,那么我建议你点下面这个链接,去Github看用中文写的模组介绍。
Chinese source text hosted on Github
如果你的网络环境无法稳定访问Github,那你可以试试下面这个链接,这是我自己部署的Gitea服务器上创建的镜像仓库
Gitea mirror

Introduction

This mod is intended to fix a bug that was reported on 26 November 2021 but has never been fixed
Bug tracker link

Features

If the server address you enter in the "Add Server" or "Direct Connect" screen contains spaces at the beginning and end of the address or in the middle of the address, this mod will automatically remove them for you.
This is to prevent the "unknown host" bug mentioned above.

Why this mod exists

A few months ago, I wanted to play on a server. I copied the address from the server's website, pasted it into "Server Address" and saved it, but it came up with "Unknown Host".
Don't panic, it's obvious that the DNS didn't find the corresponding address, so I pinged it first.
Ping can find the corresponding address of the domain name, and then I suspect that the Great Fire Wall and what to do, with the ChinaZ's tools measured, all the results and my are the same ah.
This is rather strange.
Then after tossing around for a while, I found the problem.
There was a space at the end of the server address I copied to.
This is somewhat outrageous, so after a while of tossing it around to make sure I could reproduce the problem consistently, I went to the vulnerability tracker and filed a bug.
And guess what?
IssuesRaisedOnTheVulnerabilityTracker
CommentBelow
AnRarlierProblemReport
I'm not able to speak English at all, so I didn't continue, the problem description is written in translation.
But yeah, I feel in my heart that this is more or less outrageous.
Since your address is a String class, is it hard to call the trim method later?
Also, I, as a player, can't take it when you tell me, "It's all your own carelessness, this can't even be considered a bug".
So, there's this mod.

Known Issues

All known issues have been fixed, feel free to let me know if there are any new ones.
If anyone wants to help me fix the bugs, feel free to submit a PR ╰(°▽°)╯

Open source licence

I'm using WTFPL which is more radical than MIT.


Project members

TheWhiteDog9487

Owner


Technical information

License
WTFPL
Client side
required
Server side
unsupported
Project ID