mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-30 01:38:55 +00:00
/file works
This commit is contained in:
parent
c2ff7e260b
commit
8f32936c7a
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user