Skip to content

Commit 47d453e

Browse files
authored
avoid error in domain format script (#1774)
1 parent 8db6432 commit 47d453e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Scripts/script-ExtractDomainFromUrlFormat.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,16 @@ script: |-
1616
if len(domain.group()) > 0:
1717
demisto.results(domain.group()[1:])
1818
else:
19-
domain = get_tld(inp)
20-
demisto.results(domain)
19+
domain = get_tld(inp, fail_silently=True)
20+
if not domain:
21+
inp_with_http = 'https://'+inp
22+
domain = get_tld(inp_with_http, fail_silently=True)
23+
if domain:
24+
demisto.results(domain)
25+
else:
26+
demisto.results("")
27+
else:
28+
demisto.results(domain)
2129
type: python
2230
tags:
2331
- indicator-format
@@ -30,3 +38,4 @@ args:
3038
description: The URL or Email to process
3139
scripttarget: 0
3240
dockerimage: demisto/tld
41+
releaseNotes: 'avoid error in domain format script'

0 commit comments

Comments
 (0)