@@ -615,10 +615,19 @@ def test_get(self):
615615 # check for trailing "/" which should return 404. See Issue17324
616616 response = self .request (self .base_url + '/test/' )
617617 self .check_status_and_reason (response , HTTPStatus .NOT_FOUND )
618+ response = self .request (self .base_url + '/test%2f' )
619+ self .check_status_and_reason (response , HTTPStatus .NOT_FOUND )
620+ response = self .request (self .base_url + '/test%2F' )
621+ self .check_status_and_reason (response , HTTPStatus .NOT_FOUND )
618622 response = self .request (self .base_url + '/' )
619623 self .check_status_and_reason (response , HTTPStatus .OK )
624+ response = self .request (self .base_url + '%2f' )
625+ self .check_status_and_reason (response , HTTPStatus .OK )
626+ response = self .request (self .base_url + '%2F' )
627+ self .check_status_and_reason (response , HTTPStatus .OK )
620628 response = self .request (self .base_url )
621629 self .check_status_and_reason (response , HTTPStatus .MOVED_PERMANENTLY )
630+ self .assertEqual (response .getheader ("Location" ), self .base_url + "/" )
622631 self .assertEqual (response .getheader ("Content-Length" ), "0" )
623632 response = self .request (self .base_url + '/?hi=2' )
624633 self .check_status_and_reason (response , HTTPStatus .OK )
@@ -724,6 +733,8 @@ def test_path_without_leading_slash(self):
724733 self .check_status_and_reason (response , HTTPStatus .OK )
725734 response = self .request (self .tempdir_name )
726735 self .check_status_and_reason (response , HTTPStatus .MOVED_PERMANENTLY )
736+ self .assertEqual (response .getheader ("Location" ),
737+ self .tempdir_name + "/" )
727738 response = self .request (self .tempdir_name + '/?hi=2' )
728739 self .check_status_and_reason (response , HTTPStatus .OK )
729740 response = self .request (self .tempdir_name + '?hi=1' )
0 commit comments