summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-08-25 05:44:41 -0300
committerdrebs <drebs@riseup.net>2017-09-05 11:08:47 -0300
commit8128fa904da14136874a015ee24e8203df13f00c (patch)
tree93bffde3952035c32e8bbfd97a340cd6e437c208
parentf26c027f1db489018c724a192309b93a8d8357c0 (diff)
[bug] remove incoming child from SoledadResource
-- Related: #8867
-rw-r--r--src/leap/soledad/server/_resource.py3
-rw-r--r--testing/tests/server/test__resource.py9
2 files changed, 8 insertions, 4 deletions
diff --git a/src/leap/soledad/server/_resource.py b/src/leap/soledad/server/_resource.py
index c097fad8..a9f854b6 100644
--- a/src/leap/soledad/server/_resource.py
+++ b/src/leap/soledad/server/_resource.py
@@ -86,9 +86,6 @@ class SoledadResource(Resource):
if blobs_resource:
self.putChild('blobs', blobs_resource)
- # requests to /incoming goes into IncomingResource
- self.putChild('incoming', IncomingResource())
-
# other requests are routed to legacy sync resource
self._sync_resource = get_sync_resource(sync_pool)
diff --git a/testing/tests/server/test__resource.py b/testing/tests/server/test__resource.py
index 249b62f9..f5331e35 100644
--- a/testing/tests/server/test__resource.py
+++ b/testing/tests/server/test__resource.py
@@ -24,6 +24,7 @@ from twisted.web.resource import getChildForRequest
from twisted.internet import reactor
from leap.soledad.server._resource import SoledadResource
+from leap.soledad.server._resource import LocalResource
from leap.soledad.server._server_info import ServerInfo
from leap.soledad.server._blobs import BlobsResource
from leap.soledad.server._incoming import IncomingResource
@@ -70,8 +71,14 @@ class SoledadResourceTestCase(unittest.TestCase):
self.assertIsInstance(child, WSGIResource)
self.assertIsInstance(child._application, GzipMiddleware)
- def test_get_incoming(self):
+ def test_no_incoming_on_public_resource(self):
resource = SoledadResource(None, sync_pool=_pool)
request = DummyRequest(['incoming'])
child = getChildForRequest(resource, request)
+ self.assertIsInstance(child, WSGIResource)
+
+ def test_get_incoming(self):
+ resource = LocalResource()
+ request = DummyRequest(['incoming'])
+ child = getChildForRequest(resource, request)
self.assertIsInstance(child, IncomingResource)