diff --git a/packages/rocketchat-oembed/client/oembedUrlWidget.coffee b/packages/rocketchat-oembed/client/oembedUrlWidget.coffee index 8178ac87c5a..f01d303832d 100644 --- a/packages/rocketchat-oembed/client/oembedUrlWidget.coffee +++ b/packages/rocketchat-oembed/client/oembedUrlWidget.coffee @@ -36,7 +36,10 @@ Template.oembedUrlWidget.helpers url = decodedOgImage or this.meta.twitterImage - if url?[0] is '/' and this.parsedUrl?.host? + if url.indexOf('//') is 0 + url = "#{this.parsedUrl.protocol}#{url}" + + else if url.indexOf('/') is 0 and this.parsedUrl?.host? url = "#{this.parsedUrl.protocol}//#{this.parsedUrl.host}#{url}" return url