fix: handle trailing slash in web service

Signed-off-by: The one with the braid <info@braid.business>
This commit is contained in:
The one with the braid 2024-10-14 21:21:18 +02:00
parent 8e28630523
commit 08bfebb09e

View file

@ -21,6 +21,10 @@ class PassWebService {
String? webServiceURL, String? webServiceURL,
}) { }) {
if (authenticationToken == null || webServiceURL == null) return null; if (authenticationToken == null || webServiceURL == null) return null;
// normalize the end of the URL
if (webServiceURL.endsWith('/')) {
webServiceURL = webServiceURL.substring(0, webServiceURL.length - 1);
}
final uri = Uri.tryParse(webServiceURL); final uri = Uri.tryParse(webServiceURL);
if (uri == null || uri.scheme != 'https') return null; if (uri == null || uri.scheme != 'https') return null;
return PassWebService( return PassWebService(