Hello,
It seems that this implementation doesn't send the apikey parameter on
request for full-length hashes. The result is that on queries for
blacklisted URLs I get an exception and 403 error ("ServerError:
gethash failed: HTTP Error 403: Forbidden")
Adding the apikey parameter fixed the problem for me:
--- server.py.old 2010-05-18 14:08:24.000000000 +0100
+++ server.py 2010-05-18 14:07:46.000000000 +0100
@@ -285,10 +285,15 @@
raise Error('All prefixes must have length: %d' % prefix_length)
try:
+ apikey_param = ''
+ if self._apikey:
+ apikey_param = '&apikey=' + self._apikey
+
resp = self._MakeRequest(
Server.GETHASH,
postdata='%d:%d\n%s' % (prefix_length, prefix_length * len(prefixes),
''.join(prefixes)),
+ extra_params=apikey_param,
hp=(self._gethash_host, self._gethash_port))
except ServerError, e:
orig = e.OriginalError()
Original email thread:
http://groups.google.com/group/google-safe-browsing-api/browse_thread/thread/ff2
ddd64b2f0db0b?
hl=en_US#
Original issue reported on code.google.com by noel...@google.com on 18 May 2010 at 7:41
Original issue reported on code.google.com by
noel...@google.com
on 18 May 2010 at 7:41