mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 21:43:09 +00:00
Reject URIs that contain empty segments
This commit is contained in:
parent
83b5807ca1
commit
d3d0d02855
@ -106,6 +106,16 @@ class DirectoryNodeHandler(ReplaceMeMixin, Resource, object):
|
||||
if not name:
|
||||
return self
|
||||
|
||||
# Rejecting URIs that contain empty path pieces (for example:
|
||||
# "/uri/URI:DIR2:../foo//new.txt" or "/uri/URI:DIR2:..//") was
|
||||
# the old nevow behavior and it is encoded in the test suite;
|
||||
# we will follow suit.
|
||||
for segment in req.prepath:
|
||||
if not segment:
|
||||
raise EmptyPathnameComponentError(
|
||||
u"The webapi does not allow empty pathname components",
|
||||
)
|
||||
|
||||
name = name.decode('utf8')
|
||||
d = self.node.get(name)
|
||||
d.addBoth(self._got_child, req, name)
|
||||
|
Loading…
Reference in New Issue
Block a user