2
0

🐛 (embedBubble) Fix sanitize url adding https to variable

This commit is contained in:
Baptiste Arnaud
2023-04-01 08:10:03 +02:00
parent 2dae4160bd
commit b9ae314ef9

View File

@@ -164,11 +164,14 @@ export const omit: Omit = (obj, ...keys) => {
return ret
}
const isVariableString = (str: string): boolean => /^\{\{.*\}\}$/.test(str)
export const sanitizeUrl = (url: string): string =>
url.startsWith('http') ||
url.startsWith('mailto:') ||
url.startsWith('tel:') ||
url.startsWith('sms:')
url.startsWith('sms:') ||
isVariableString(url)
? url
: `https://${url}`