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)
|
return text_plain(filenode.get_readonly_uri(), req)
|
||||||
|
|
||||||
class FileNodeDownloadHandler(FileNodeHandler):
|
class FileNodeDownloadHandler(FileNodeHandler):
|
||||||
def childFactory(self, req, name):
|
def getChild(self, name, req):
|
||||||
return FileNodeDownloadHandler(self.client, self.node, name=name)
|
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
|
# I handle /file/$FILECAP[/IGNORED] , which provides a URL from which a
|
||||||
# file can be downloaded correctly by tools like "wget".
|
# file can be downloaded correctly by tools like "wget".
|
||||||
|
|
||||||
def __init__(self, client):
|
def __init__(self, client):
|
||||||
rend.Page.__init__(self, client)
|
super(FileHandler, self).__init__()
|
||||||
self.client = client
|
self.client = client
|
||||||
|
|
||||||
def childFactory(self, ctx, name):
|
def getChild(self, name, req):
|
||||||
req = IRequest(ctx)
|
|
||||||
if req.method not in ("GET", "HEAD"):
|
if req.method not in ("GET", "HEAD"):
|
||||||
raise WebError("/file can only be used with GET or HEAD")
|
raise WebError("/file can only be used with GET or HEAD")
|
||||||
# 'name' must be a file URI
|
# 'name' must be a file URI
|
||||||
|
Loading…
Reference in New Issue
Block a user