mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
Add test to exercise memove() in make_safe_url()
This commit is contained in:
parent
ecfac80174
commit
e6680c4f2f
@ -189,8 +189,8 @@ class TestFileGet(TestHelper):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
os.unlink(self.fn)
|
os.unlink(self.fn)
|
||||||
|
|
||||||
def test_file_get(self):
|
def get_helper(self, url):
|
||||||
resp = Conn().get(self.url)
|
resp = Conn().get(url)
|
||||||
status, hdrs, body = parse(resp)
|
status, hdrs, body = parse(resp)
|
||||||
self.assertContains(status, "200 OK")
|
self.assertContains(status, "200 OK")
|
||||||
self.assertEquals(hdrs["Accept-Ranges"], "bytes")
|
self.assertEquals(hdrs["Accept-Ranges"], "bytes")
|
||||||
@ -199,6 +199,12 @@ class TestFileGet(TestHelper):
|
|||||||
self.assertContains(hdrs["Server"], "darkhttpd/")
|
self.assertContains(hdrs["Server"], "darkhttpd/")
|
||||||
self.assertEquals(body, self.data)
|
self.assertEquals(body, self.data)
|
||||||
|
|
||||||
|
def test_file_get(self):
|
||||||
|
self.get_helper(self.url)
|
||||||
|
|
||||||
|
def test_file_get_redundant_dots(self):
|
||||||
|
self.get_helper("/././." + self.url)
|
||||||
|
|
||||||
def test_file_head(self):
|
def test_file_head(self):
|
||||||
resp = Conn().get(self.url, method="HEAD")
|
resp = Conn().get(self.url, method="HEAD")
|
||||||
status, hdrs, body = parse(resp)
|
status, hdrs, body = parse(resp)
|
||||||
|
Loading…
Reference in New Issue
Block a user