mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
More tests.
This commit is contained in:
parent
8586258fbf
commit
c16f5c1007
@ -56,6 +56,18 @@ class TestCases(unittest.TestCase):
|
||||
body = Conn().get("GET /dir/../ HTTP/1.0\n\n")
|
||||
self.assertIsIndex(body, "/dir/../")
|
||||
|
||||
def testExtraneousSlashes(self):
|
||||
body = Conn().get("GET //dir///..//// HTTP/1.0\n\n")
|
||||
self.assertIsIndex(body, "//dir///..////")
|
||||
|
||||
def testWithoutTrailingSlash(self):
|
||||
body = Conn().get("GET /dir/.. HTTP/1.0\n\n")
|
||||
self.assertIsIndex(body, "/dir/..")
|
||||
|
||||
def testWithoutLeadingSlashFails(self):
|
||||
body = Conn().get("GET dir/../ HTTP/1.0\n\n")
|
||||
self.assertIsInvalid(body, "dir/../")
|
||||
|
||||
def testUpDirInvalid(self):
|
||||
body = Conn().get("GET /../ HTTP/1.0\n\n")
|
||||
self.assertIsInvalid(body, "/../")
|
||||
|
Loading…
Reference in New Issue
Block a user