From e583b87e6846a25e6f443e053eaa1f898ca81538 Mon Sep 17 00:00:00 2001 From: Daniel Ponte Date: Wed, 14 Aug 2024 10:01:55 -0400 Subject: [PATCH] trim slash --- lib/controller/stillbox.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/controller/stillbox.dart b/lib/controller/stillbox.dart index e96c146..2b4aa6c 100644 --- a/lib/controller/stillbox.dart +++ b/lib/controller/stillbox.dart @@ -66,7 +66,12 @@ class Stillbox extends ChangeNotifier { baseUri = Uri.parse(uri); setUris(); } - Uri loginUri = Uri.parse('${baseUri!}/login'); + String baseUriString = baseUri.toString(); + // trim trailing slash since gordio router really dislikes it + if (baseUriString.endsWith('/')) { + baseUriString = baseUriString.substring(0, baseUriString.length - 1); + } + Uri loginUri = Uri.parse('$baseUriString/login'); final form = {}; form['username'] = username; form['password'] = password;