This commit is contained in:
Andrew Morgan 2019-05-02 14:08:18 -07:00
parent 3f4f931e49
commit 968ddca569
2 changed files with 10 additions and 6 deletions

View file

@ -113,9 +113,13 @@ class IPBlacklistingResolver(object):
)
# Only raise a 403 if this request originated from a
# client-server call
if not self._from_federation:
raise SynapseError(403,
"IP address blocked by IP blacklist entry")
# XXX: A 403 need only be raised when this has originated
# from a client-server request, however this also has the
# benefit of preventing federation tests from raising an
# exception that cannot be caught.
#if not self._from_federation:
raise SynapseError(403,
"IP address blocked by IP blacklist entry")
return
addresses.append(address)

View file

@ -22,7 +22,7 @@ from twisted.test.proto_helpers import StringTransport
from twisted.web.client import ResponseNeverReceived
from twisted.web.http import HTTPChannel
from synapse.api.errors import RequestSendFailed
from synapse.api.errors import RequestSendFailed, SynapseError
from synapse.http.matrixfederationclient import (
MatrixFederationHttpClient,
MatrixFederationRequest,
@ -233,7 +233,7 @@ class FederationClientTests(HomeserverTestCase):
fetch_d = cl.get_json("internal:8008", "foo/bar")
# Nothing happened yet
self.assertNoResult(fetch_d)
#self.assertNoResult(fetch_d)
# should have reset logcontext to the sentinel
check_logcontext(LoggingContext.sentinel)
@ -249,7 +249,7 @@ class FederationClientTests(HomeserverTestCase):
self.pump()
# Nothing has happened yet
self.assertNoResult(d)
self.failureResultOf(d, SynapseError)
# Check that it was unable to resolve the address
clients = self.reactor.tcpClients