mirror of
https://github.com/mvt-project/mvt.git
synced 2026-02-12 16:42:45 +00:00
Improves WebkitResourceLoadStatistics module
This commit is contained in:
@@ -237,6 +237,8 @@ class Indicators:
|
||||
# being matched.
|
||||
if not url:
|
||||
return None
|
||||
if not isinstance(url, str):
|
||||
return None
|
||||
|
||||
try:
|
||||
# First we use the provided URL.
|
||||
|
||||
@@ -70,7 +70,15 @@ class WebkitResourceLoadStatistics(IOSExtraction):
|
||||
cur = conn.cursor()
|
||||
|
||||
try:
|
||||
cur.execute("SELECT * from ObservedDomains;")
|
||||
# FIXME: table contains extra fields with timestamp here
|
||||
cur.execute("""
|
||||
SELECT
|
||||
domainID,
|
||||
registrableDomain,
|
||||
lastSeen,
|
||||
hadUserInteraction
|
||||
from ObservedDomains;
|
||||
""")
|
||||
except sqlite3.OperationalError:
|
||||
return
|
||||
|
||||
|
||||
@@ -24,8 +24,10 @@ class TestIndicators:
|
||||
def test_check_domain(self, indicator_file):
|
||||
ind = Indicators(log=logging)
|
||||
ind.load_indicators_files([indicator_file], load_default=False)
|
||||
assert ind.check_domain(42) is None
|
||||
assert ind.check_domain("https://www.example.org/foobar")
|
||||
assert ind.check_domain("http://example.org:8080/toto")
|
||||
assert ind.check_domain("https://github.com") is None
|
||||
|
||||
def test_check_android_property(self, indicator_file):
|
||||
ind = Indicators(log=logging)
|
||||
|
||||
Reference in New Issue
Block a user