chiark / gitweb /
server: new NotStupidResource
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 4 Apr 2017 16:15:07 +0000 (17:15 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 4 Apr 2017 16:15:07 +0000 (17:15 +0100)
hippotatd

index 1e9348e..32d9a34 100755 (executable)
--- a/hippotatd
+++ b/hippotatd
@@ -176,8 +176,13 @@ def log_http(desca, msg, **kwargs):
     pass
   log_debug(DBG.HTTP, msg + repr(desca), **kwargs)
 
-class IphttpResource(twisted.web.resource.Resource):
-  isLeaf = True
+class NotStupidResource(twisted.web.resource.Resource):
+  # why this is not the default is a mystery!
+  def getChild(self, name, request):
+    if name == b'': return self
+    else: return twisted.web.resource.Resource.getChild(name, request)
+
+class IphttpResource(NotStupidResource):
   def render_POST(self, request):
     log_debug(DBG.HTTP_FULL,
               'req recv: ' + repr(request) + ' ' + repr(request.args),