mirror of
https://github.com/python/cpython.git
synced 2025-07-16 07:45:20 +00:00
Fix http.server's request handling case on trailing '/'.
Patch contributed by Vajrasky Kok. Addresses Issue #17324
This commit is contained in:
parent
016af3f4d4
commit
72c238e21a
3 changed files with 11 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue