Use url netloc as a candidate key for qute-pass

This commit is contained in:
Roberto Alsina 2023-05-30 19:13:59 -03:00
parent f26ea37c41
commit a31b654252
1 changed files with 5 additions and 2 deletions

View File

@ -58,6 +58,7 @@ import re
import shlex
import subprocess
import sys
from urllib.parse import urlparse
import tldextract
@ -221,7 +222,7 @@ def main(arguments):
# Try to find candidates using targets in the following order: fully-qualified domain name (includes subdomains),
# the registered domain name, the IPv4 address if that's what the URL represents and finally the private domain
# (if a non-public suffix was used).
# (if a non-public suffix was used), and the URL netloc.
candidates = set()
attempted_targets = []
@ -230,7 +231,9 @@ def main(arguments):
private_domain = ('.'.join((extract_result.subdomain, extract_result.domain))
if extract_result.subdomain else extract_result.domain)
for target in filter(None, [extract_result.fqdn, extract_result.registered_domain, extract_result.ipv4, private_domain]):
netloc = urlparse(arguments.url).netloc
for target in filter(None, [extract_result.fqdn, extract_result.registered_domain, extract_result.ipv4, private_domain, netloc]):
attempted_targets.append(target)
target_candidates = find_pass_candidates(target, unfiltered=arguments.unfiltered)
if not target_candidates: