Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pyhindsight/browsers/chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -2141,7 +2141,14 @@ def build_hsts_domain_hashes(self):
domains = set()
for artifact in self.parsed_artifacts:
if isinstance(artifact, self.HistoryItem):
domain = urllib.parse.urlparse(artifact.url).hostname
artifact_url = artifact.url

# Cookie artifact's "URLs" will be in the form ".example.com",
# which won't parse, so modify it so it will
if artifact_url.startswith('.'):
artifact_url = 'http://' + artifact_url[1:]

domain = urllib.parse.urlparse(artifact_url).hostname
# Some URLs don't have a domain, like local PDF files
if domain:
domains.add(domain)
Expand Down