@@ -692,10 +692,19 @@ def test_get(self):
692692 # check for trailing "/" which should return 404. See Issue17324
693693 response = self .request (self .base_url + '/test/' )
694694 self .check_status_and_reason (response , HTTPStatus .NOT_FOUND )
695+ response = self .request (self .base_url + '/test%2f' )
696+ self .check_status_and_reason (response , HTTPStatus .NOT_FOUND )
697+ response = self .request (self .base_url + '/test%2F' )
698+ self .check_status_and_reason (response , HTTPStatus .NOT_FOUND )
695699 response = self .request (self .base_url + '/' )
696700 self .check_status_and_reason (response , HTTPStatus .OK )
701+ response = self .request (self .base_url + '%2f' )
702+ self .check_status_and_reason (response , HTTPStatus .OK )
703+ response = self .request (self .base_url + '%2F' )
704+ self .check_status_and_reason (response , HTTPStatus .OK )
697705 response = self .request (self .base_url )
698706 self .check_status_and_reason (response , HTTPStatus .MOVED_PERMANENTLY )
707+ self .assertEqual (response .getheader ("Location" ), self .base_url + "/" )
699708 self .assertEqual (response .getheader ("Content-Length" ), "0" )
700709 response = self .request (self .base_url + '/?hi=2' )
701710 self .check_status_and_reason (response , HTTPStatus .OK )
@@ -801,6 +810,8 @@ def test_path_without_leading_slash(self):
801810 self .check_status_and_reason (response , HTTPStatus .OK )
802811 response = self .request (self .tempdir_name )
803812 self .check_status_and_reason (response , HTTPStatus .MOVED_PERMANENTLY )
813+ self .assertEqual (response .getheader ("Location" ),
814+ self .tempdir_name + "/" )
804815 response = self .request (self .tempdir_name + '/?hi=2' )
805816 self .check_status_and_reason (response , HTTPStatus .OK )
806817 response = self .request (self .tempdir_name + '?hi=1' )
0 commit comments