]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
webish: strip leading/tailing whitespace from user-provided URIs
authorBrian Warner <warner@lothar.com>
Sat, 25 Aug 2007 19:05:06 +0000 (12:05 -0700)
committerBrian Warner <warner@lothar.com>
Sat, 25 Aug 2007 19:05:06 +0000 (12:05 -0700)
src/allmydata/webish.py

index 703f9a1093cfd0fd34f41741ce33a234aecf1fbe..633aef7e6d3fab9e3649ea87b835a68dbe0d0b2c 100644 (file)
@@ -616,9 +616,9 @@ class POSTHandler(rend.Page):
             if not name:
                 raise RuntimeError("set-uri requires a name")
             if "uri" in req.args:
-                newuri = req.args["uri"][0]
+                newuri = req.args["uri"][0].strip()
             else:
-                newuri = req.fields["uri"].value
+                newuri = req.fields["uri"].value.strip()
             d = self._check_replacement(name)
             d.addCallback(lambda res: self._node.set_uri(name, newuri))
             def _done(res):