mirror of
https://github.com/reconurge/flowsint.git
synced 2026-04-30 03:09:05 -05:00
fix(transforms): domain_to_websites always returns inactive
This commit is contained in:
@@ -53,7 +53,7 @@ class DomainToWebsiteTransform(Transform):
|
|||||||
https_url, timeout=10, allow_redirects=True
|
https_url, timeout=10, allow_redirects=True
|
||||||
)
|
)
|
||||||
if response.status_code < 400:
|
if response.status_code < 400:
|
||||||
results.append(Website(url=https_url, domain=domain))
|
results.append(Website(url=https_url, domain=domain, active=True))
|
||||||
continue
|
continue
|
||||||
except requests.RequestException:
|
except requests.RequestException:
|
||||||
pass
|
pass
|
||||||
@@ -63,13 +63,13 @@ class DomainToWebsiteTransform(Transform):
|
|||||||
http_url = f"http://{domain.domain}"
|
http_url = f"http://{domain.domain}"
|
||||||
response = requests.head(http_url, timeout=10, allow_redirects=True)
|
response = requests.head(http_url, timeout=10, allow_redirects=True)
|
||||||
if response.status_code < 400:
|
if response.status_code < 400:
|
||||||
results.append(Website(url=http_url, domain=domain))
|
results.append(Website(url=http_url, domain=domain, active=True))
|
||||||
continue
|
continue
|
||||||
except requests.RequestException:
|
except requests.RequestException:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# If both fail, still add HTTPS URL as default
|
# If both fail, still add HTTPS URL as default
|
||||||
results.append(Website(url=f"https://{domain.domain}", domain=domain))
|
results.append(Website(url=f"https://{domain.domain}", domain=domain, active=False))
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Logger.error(
|
Logger.error(
|
||||||
@@ -79,7 +79,7 @@ class DomainToWebsiteTransform(Transform):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
# Add HTTPS URL as fallback
|
# Add HTTPS URL as fallback
|
||||||
results.append(Website(url=f"https://{domain.domain}", domain=domain))
|
results.append(Website(url=f"https://{domain.domain}", domain=domain, active=False))
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user