Fix http.server's request handling case on trailing '/'.

Patch contributed by Vajrasky Kok. Addresses Issue #17324
This commit is contained in:
Senthil Kumaran 2013-09-13 00:21:18 -07:00
parent 016af3f4d4
commit 72c238e21a
3 changed files with 11 additions and 0 deletions

View file

@ -249,6 +249,9 @@ class SimpleHTTPServerTestCase(BaseTestCase):
#constructs the path relative to the root directory of the HTTPServer
response = self.request(self.tempdir_name + '/test')
self.check_status_and_reason(response, 200, data=self.data)
# check for trailing "/" which should return 404. See Issue17324
response = self.request(self.tempdir_name + '/test/')
self.check_status_and_reason(response, 404)
response = self.request(self.tempdir_name + '/')
self.check_status_and_reason(response, 200)
response = self.request(self.tempdir_name)