From f2e205313485e458e2f5186f743d527d28609c5e Mon Sep 17 00:00:00 2001
From: Sefa Eyeoglu <contact@scrumplex.net>
Date: Sun, 22 May 2022 13:55:19 +0200
Subject: feat: add trailing slash to meta URL if it is missing

---
 launcher/ui/pages/global/APIPage.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/launcher/ui/pages/global/APIPage.cpp b/launcher/ui/pages/global/APIPage.cpp
index af58b8cd..6ad243dd 100644
--- a/launcher/ui/pages/global/APIPage.cpp
+++ b/launcher/ui/pages/global/APIPage.cpp
@@ -148,6 +148,13 @@ void APIPage::applySettings()
     QString msaClientID = ui->msaClientID->text();
     s->set("MSAClientIDOverride", msaClientID);
     QUrl metaURL = ui->metaURL->text();
+    // Add required trailing slash
+    if (!metaURL.isEmpty() && !metaURL.path().endsWith('/'))
+    {
+        QString path = metaURL.path();
+        path.append('/');
+        metaURL.setPath(path);
+    }
     // Don't allow HTTP, since meta is basically RCE with all the jar files.
     if(!metaURL.isEmpty() && metaURL.scheme() == "http")
     {
-- 
cgit