google_safe_browsing_redis 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/google_safe_browsing.rb +6 -1
- metadata +1 -1
data/lib/google_safe_browsing.rb
CHANGED
@@ -50,7 +50,7 @@ class GoogleSafeBrowsing
|
|
50
50
|
# perform a lookup on a url
|
51
51
|
def lookup(url)
|
52
52
|
say("Checking url: #{url}")
|
53
|
-
url, parts =
|
53
|
+
url, parts = canonicalize(url)
|
54
54
|
hosts, paths = get_possible_hosts_paths(parts)
|
55
55
|
|
56
56
|
# get all possible host+path combination hash prefixes
|
@@ -76,6 +76,11 @@ class GoogleSafeBrowsing
|
|
76
76
|
return ''
|
77
77
|
end
|
78
78
|
|
79
|
+
# returns the canonicalized url, and a hash of its parts
|
80
|
+
def canonicalize(url)
|
81
|
+
return Canonicalize::canonicalize(url)
|
82
|
+
end
|
83
|
+
|
79
84
|
# convert an array of strings into an array of 32 bit hash prefixes
|
80
85
|
def get_hash_prefixes(items)
|
81
86
|
prefixes = []
|