From dd38876965ae4bdd0da359bfcc64071761e47648 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Sun, 20 Mar 2022 22:59:42 -0400
Subject: [PATCH] Fix adding grid with random whitespace at beginning and end

---
 indra/newview/llviewernetwork.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp
index 7a574b66dce..d25da10a5bc 100644
--- a/indra/newview/llviewernetwork.cpp
+++ b/indra/newview/llviewernetwork.cpp
@@ -435,6 +435,7 @@ void LLGridManager::addRemoteGrid(const std::string& login_uri, const EAddGridTy
 	if (login_uri.empty()) return;
 
 	std::string grid = utf8str_tolower(login_uri);
+	LLStringUtil::trim(grid);
 	// Grid needs to be in the form of a dns address,
 	// but also support localhost:9000 or localhost:9000/login
 	if (grid.find_first_not_of("abcdefghijklmnopqrstuvwxyz1234567890-_.:/@% ") != std::string::npos)
-- 
GitLab