This commit is contained in:
Andrew Morgan 2019-05-03 14:27:30 -07:00
parent 13f430cee4
commit e2bc9af798
2 changed files with 6 additions and 3 deletions

View file

@ -103,7 +103,8 @@ class IPBlacklistingResolver(object):
ip_address, self._ip_whitelist, self._ip_blacklist ip_address, self._ip_whitelist, self._ip_blacklist
): ):
logger.info( logger.info(
"Dropped %s from DNS resolution to %s due to blacklist" % (ip_address, hostname) "Dropped %s from DNS resolution to %s due to blacklist" %
(ip_address, hostname)
) )
has_bad_ip = True has_bad_ip = True
@ -164,7 +165,8 @@ class BlacklistingAgentWrapper(Agent):
ip_address, self._ip_whitelist, self._ip_blacklist ip_address, self._ip_whitelist, self._ip_blacklist
): ):
logger.info( logger.info(
"Blocking access to %s because of blacklist. Returning 0 results" % (ip_address,) "Blocking access to %s because of blacklist. Returning 0 results" %
(ip_address,)
) )
e = SynapseError(404, "No results found") e = SynapseError(404, "No results found")
return defer.fail(Failure(e)) return defer.fail(Failure(e))

View file

@ -335,7 +335,8 @@ class PreviewUrlResource(Resource):
if isinstance(e, DNSLookupError): if isinstance(e, DNSLookupError):
# DNS lookup returned no results # DNS lookup returned no results
# Note: This will also be the case if the found IP address is blacklisted # Note: This will also be the case if the found IP address
# is blacklisted
raise SynapseError( raise SynapseError(
404, "No results found", Codes.UNKNOWN 404, "No results found", Codes.UNKNOWN
) )