From 07ea6d1d8a1eab0746b1d06dd06cbac8d0a18154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Felchar?= <11652381+cauefcr@users.noreply.github.com> Date: Fri, 2 Dec 2022 09:59:10 -0300 Subject: [PATCH] [FIX] Livechat: Allow resolving external image and media blocks (#27387) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/livechat/src/components/helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livechat/src/components/helpers.js b/packages/livechat/src/components/helpers.js index 0223813ae32..f7319445ffc 100644 --- a/packages/livechat/src/components/helpers.js +++ b/packages/livechat/src/components/helpers.js @@ -129,7 +129,7 @@ export const msgTypesNotRendered = ['livechat_video_call', 'livechat_navigation_ export const canRenderMessage = ({ t }) => !msgTypesNotRendered.includes(t); -export const getAttachmentUrl = (url) => `${Livechat.client.host}${url}`; +export const getAttachmentUrl = (url) => new URL(url, Livechat.client.host).toString(); export const sortArrayByColumn = (array, column, inverted) => array.sort((a, b) => {