summary refs log tree commit diff
path: root/synapse/util/httpresourcetree.py
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@arasphere.net>2018-03-23 11:10:32 +0000
committerGitHub <noreply@github.com>2018-03-23 11:10:32 +0000
commitb7e7b52452493f0abc76b0e75bed7c6b594333ae (patch)
tree7c379c9bb712e64fe61b2de2d181e5780117ab54 /synapse/util/httpresourcetree.py
parentMerge pull request #3006 from matrix-org/erikj/state_iter (diff)
parent404 correctly on missing paths via NoResource (diff)
downloadsynapse-b7e7b52452493f0abc76b0e75bed7c6b594333ae.tar.xz
Merge pull request #3022 from matrix-org/matthew/noresource
404 correctly on missing paths via NoResource
Diffstat (limited to 'synapse/util/httpresourcetree.py')
-rw-r--r--synapse/util/httpresourcetree.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/util/httpresourcetree.py b/synapse/util/httpresourcetree.py
index 45be47159a..d747849553 100644
--- a/synapse/util/httpresourcetree.py
+++ b/synapse/util/httpresourcetree.py
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from twisted.web.resource import Resource
+from twisted.web.resource import NoResource
 
 import logging
 
@@ -45,7 +45,7 @@ def create_resource_tree(desired_tree, root_resource):
         for path_seg in full_path.split('/')[1:-1]:
             if path_seg not in last_resource.listNames():
                 # resource doesn't exist, so make a "dummy resource"
-                child_resource = Resource()
+                child_resource = NoResource()
                 last_resource.putChild(path_seg, child_resource)
                 res_id = _resource_id(last_resource, path_seg)
                 resource_mappings[res_id] = child_resource