diff --git a/src/allmydata/web/filenode.py b/src/allmydata/web/filenode.py index 71de6e7b9..541c88e05 100644 --- a/src/allmydata/web/filenode.py +++ b/src/allmydata/web/filenode.py @@ -521,5 +521,5 @@ def FileReadOnlyURI(req, filenode): return text_plain(filenode.get_readonly_uri(), req) class FileNodeDownloadHandler(FileNodeHandler): - def childFactory(self, req, name): + def getChild(self, name, req): return FileNodeDownloadHandler(self.client, self.node, name=name) diff --git a/src/allmydata/web/root.py b/src/allmydata/web/root.py index 3d8a84135..6e4ac7b17 100644 --- a/src/allmydata/web/root.py +++ b/src/allmydata/web/root.py @@ -150,16 +150,15 @@ class URIHandler(resource.Resource, object): ) -class FileHandler(rend.Page): +class FileHandler(resource.Resource, object): # I handle /file/$FILECAP[/IGNORED] , which provides a URL from which a # file can be downloaded correctly by tools like "wget". def __init__(self, client): - rend.Page.__init__(self, client) + super(FileHandler, self).__init__() self.client = client - def childFactory(self, ctx, name): - req = IRequest(ctx) + def getChild(self, name, req): if req.method not in ("GET", "HEAD"): raise WebError("/file can only be used with GET or HEAD") # 'name' must be a file URI