From 27ad8f07c30010ec8e7504d9742fbfaf0d68e664 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Mon, 2 Nov 2020 11:16:34 +0200 Subject: [PATCH] Trim url before opening in browser --- src/status_im/utils/http.cljs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/status_im/utils/http.cljs b/src/status_im/utils/http.cljs index 38fde2dbd4..1fa7d3f8a4 100644 --- a/src/status_im/utils/http.cljs +++ b/src/status_im/utils/http.cljs @@ -112,7 +112,10 @@ (.catch (or on-error #()))))) (defn normalize-url [url] - (str (when (and (string? url) (not (re-find #"^[a-zA-Z-_]+:/" url))) "https://") url)) + (str (when (and (string? url) + (not (re-find #"^[a-zA-Z-_]+:/" url))) + "https://") + ((fnil string/trim "") url))) (def normalize-and-decode-url (comp js/decodeURI normalize-url))