From 9e6edb2b8f53a2d8bb2ed3850ed8259e5ea8b6e4 Mon Sep 17 00:00:00 2001 From: miniduikboot Date: Sun, 27 Mar 2022 15:20:05 +0200 Subject: [PATCH] Trim address before considering it further Previously: - If the address was an ip, the space would be added into the resulting file, causing connection issues - If the address was a DNS address, resolving would fail By sanitizing the data at the start this is prevented. --- script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script.js b/script.js index 89924465..6c5bf5eb 100644 --- a/script.js +++ b/script.js @@ -34,7 +34,7 @@ async function parseAddressAsync(serverAddress) { } function parseForm() { - const serverAddress = document.getElementById("address").value; + const serverAddress = document.getElementById("address").value.trim(); const serverPort = parseInt(document.getElementById("port").value) ?? DEFAULT_PORT; const serverName = document.getElementById("name").value || "Impostor";