From f1fcdf73791895a2b3d0acd1bd7881ced66f6b33 Mon Sep 17 00:00:00 2001
From: Guilherme Siqueira <guilhersiqueira@gmail.com>
Date: Tue, 17 Dec 2019 11:11:24 -0300
Subject: [PATCH] [FIX] Crash while displaying the attached image with http on
 file name (#1401)

---
 app/lib/utils.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/lib/utils.js b/app/lib/utils.js
index 8f14bd4c5..56e8a0a6c 100644
--- a/app/lib/utils.js
+++ b/app/lib/utils.js
@@ -1,3 +1,3 @@
 export const formatAttachmentUrl = (attachmentUrl, userId, token, server) => (
-	encodeURI(attachmentUrl.includes('http') ? attachmentUrl : `${ server }${ attachmentUrl }?rc_uid=${ userId }&rc_token=${ token }`)
+	encodeURI(attachmentUrl.startsWith('http') ? attachmentUrl : `${ server }${ attachmentUrl }?rc_uid=${ userId }&rc_token=${ token }`)
 );
-- 
GitLab