feat(clean_url): esvalabs

This commit is contained in:
MDLeom 2025-11-13 08:27:10 +00:00
parent c242de27ea
commit b68209e14b
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 7 additions and 1 deletions

View File

@ -19,7 +19,8 @@ const safeLinks = [
'safelinks\\.protection\\.outlook\\.com',
'\\.protection\\.sophos\\.com',
'linkprotect\\.cudasvc\\.com',
'ctp\\.trendmicro\\.com'
'ctp\\.trendmicro\\.com',
'urlsand\\.esvalabs\\.com'
]
const deSafelink = (urlStr) => {
@ -87,6 +88,11 @@ const deSafelink = (urlStr) => {
url = new URL(url.searchParams.get('q'))
}
// EsvaLabs
if (url.hostname === 'urlsand.esvalabs.com') {
url = new URL(url.searchParams.get('u'))
}
// "Just have to go deep enough."
if (url.hostname.match(new RegExp(safeLinks.join('|')))) {
return deSafelink(url.href)