File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -384,16 +384,22 @@ function escapeRegexStr(string) {
384384}
385385
386386function getRelayData ( url ) {
387- let urlparts = new URL ( url ) ;
387+ let urlparts ;
388+ try {
389+ urlparts = new URL ( url ) ;
390+ } catch {
391+ urlparts = { } ;
392+ }
388393 let targetMx = {
389394 host : urlparts . hostname ,
390395 port : urlparts . port || 25 ,
391- auth : urlparts . username || urlparts . password
392- ? {
393- user : decodeURIComponent ( urlparts . username || '' ) ,
394- pass : decodeURIComponent ( urlparts . password || '' )
395- }
396- : false ,
396+ auth :
397+ urlparts . username || urlparts . password
398+ ? {
399+ user : decodeURIComponent ( urlparts . username || '' ) ,
400+ pass : decodeURIComponent ( urlparts . password || '' )
401+ }
402+ : false ,
397403 secure : urlparts . protocol === 'smtps:' ,
398404 A : [ ] . concat ( net . isIPv4 ( urlparts . hostname ) ? urlparts . hostname : [ ] ) ,
399405 AAAA : [ ] . concat ( net . isIPv6 ( urlparts . hostname ) ? urlparts . hostname : [ ] )
You can’t perform that action at this time.
0 commit comments