mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
Escape URLs according to RFC3986.
Previously, we weren't escaping parentheses when generating directory listings. Pointed out by: Wijatmoko U. Prayitno
This commit is contained in:
@@ -151,7 +151,7 @@ class TestHelper(unittest.TestCase):
|
||||
|
||||
class TestDirList(TestHelper):
|
||||
def setUp(self):
|
||||
self.fn = WWWROOT+"/escape#this"
|
||||
self.fn = WWWROOT+"/escape(this)name"
|
||||
open(self.fn, "w").write("x"*12345)
|
||||
|
||||
def tearDown(self):
|
||||
@@ -161,7 +161,7 @@ class TestDirList(TestHelper):
|
||||
resp = self.get("/")
|
||||
status, hdrs, body = parse(resp)
|
||||
self.assertEquals(ord("#"), 0x23)
|
||||
self.assertContains(body, "escape%23this", "12345")
|
||||
self.assertContains(body, "escape%28this%29name", "12345")
|
||||
|
||||
class TestCases(TestHelper):
|
||||
pass # these get autogenerated in setUpModule()
|
||||
|
||||
Reference in New Issue
Block a user