diff options
author | Andrew Morgan <andrew@amorgan.xyz> | 2019-05-03 14:27:30 -0700 |
---|---|---|
committer | Andrew Morgan <andrew@amorgan.xyz> | 2019-05-03 14:27:30 -0700 |
commit | e2bc9af79846736ad4a167061267bbfd2f8bbfc0 (patch) | |
tree | 18517d9fa4a0eca425e52da881de02132ecb0c6f | |
parent | Same behavior for no result and result blacklisted (diff) | |
download | synapse-e2bc9af79846736ad4a167061267bbfd2f8bbfc0.tar.xz |
lint
-rw-r--r-- | synapse/http/client.py | 6 | ||||
-rw-r--r-- | synapse/rest/media/v1/preview_url_resource.py | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/synapse/http/client.py b/synapse/http/client.py index 30e8b287b6..368b0d49b7 100644 --- a/synapse/http/client.py +++ b/synapse/http/client.py @@ -103,7 +103,8 @@ class IPBlacklistingResolver(object): ip_address, self._ip_whitelist, self._ip_blacklist ): 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 @@ -164,7 +165,8 @@ class BlacklistingAgentWrapper(Agent): ip_address, self._ip_whitelist, self._ip_blacklist ): 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") return defer.fail(Failure(e)) diff --git a/synapse/rest/media/v1/preview_url_resource.py b/synapse/rest/media/v1/preview_url_resource.py index 07882bbd80..f1f24ebd1c 100644 --- a/synapse/rest/media/v1/preview_url_resource.py +++ b/synapse/rest/media/v1/preview_url_resource.py @@ -335,7 +335,8 @@ class PreviewUrlResource(Resource): if isinstance(e, DNSLookupError): # 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( 404, "No results found", Codes.UNKNOWN ) |