mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
fix(create-call): fix url parsing (#1235)
This commit is contained in:
@@ -116,8 +116,8 @@ const customSanitizeFunction = (value) => {
|
|||||||
/* trims characters at the beginning and at the end of a string */
|
/* trims characters at the beginning and at the end of a string */
|
||||||
value = value.trim();
|
value = value.trim();
|
||||||
|
|
||||||
/* Verify strings including 'http' via new URL */
|
// Only attempt to parse if the whole string is a URL
|
||||||
if (value.includes('http')) {
|
if (/^https?:\/\/\S+$/.test(value)) {
|
||||||
value = new URL(value).toString();
|
value = new URL(value).toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user