From: Ian Jackson Date: Tue, 4 Apr 2017 16:15:07 +0000 (+0100) Subject: server: new NotStupidResource X-Git-Tag: hippotat/1.0.0~55^2~102 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=hippotat.git;a=commitdiff_plain;h=eb113b2c70237a415fc3c730fa9115fa4add1233 server: new NotStupidResource --- diff --git a/hippotatd b/hippotatd index 1e9348e..32d9a34 100755 --- 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),