mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 13:06:01 -04:00
404 correctly on missing paths via NoResource
fixes https://github.com/matrix-org/synapse/issues/2043 and https://github.com/matrix-org/synapse/issues/2029
This commit is contained in:
parent
84b5cc69f5
commit
8cbbfaefc1
12 changed files with 24 additions and 24 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue