fix: email sanitizer

This commit is contained in:
Shivam Mishra
2025-08-21 14:40:15 +05:30
parent 7fe94dc1a2
commit 729a551571
+4 -3
View File
@@ -60,15 +60,16 @@ const sanitizeURL = url => {
const parsedURL = new URL(url);
// filter out dangerous protocols like `javascript`, `data`, `vbscript`
if (!['https', 'http'].includes(parsedURL.protocol)) {
if (!['https:', 'http:'].includes(parsedURL.protocol)) {
throw new Error('Invalid Protocol');
}
return url; // Return the original valid URL
} catch (e) {
// eslint-disable-next-line no-console
console.error('Invalid URL', e);
return 'about:blank'; // Only return blank for invalid URLs
}
return 'about:blank'; // blank page URL
};
export const IFrameHelper = {