splunk / utbox

URL Toolbox (UTBox) is a set of building blocks for Splunk specially created for URL manipulation. UTBox has been created to be modular, easy to use and easy to deploy in any Splunk environments.
https://preview.splunkbase.splunk.com/app/2734/
Apache License 2.0
8 stars 6 forks source link

Wrong ut_tld and ut_domain if a valid TLD is in the middle of the string but not at the end #14

Open teresachila opened 1 week ago

teresachila commented 1 week ago

Example: 1.something.com.local This is not a valid domain, however, since "com" is in the middle of the string, it returns "com" as ut_tld and "l.com" as ut_domain. It should return None instead.

Suggested fix: In ut_parse_lib.py, under the findTLD() function, add the following check right before returning TLD:

    if (len(items)>0 and items[-1]!=parts[-1]):
         # the TLD is not found at the end of the string, not a valid TLD
         TLD=None