@@ -692,10 +692,19 @@ def test_get(self):
692
692
# check for trailing "/" which should return 404. See Issue17324
693
693
response = self .request (self .base_url + '/test/' )
694
694
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 )
695
699
response = self .request (self .base_url + '/' )
696
700
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 )
697
705
response = self .request (self .base_url )
698
706
self .check_status_and_reason (response , HTTPStatus .MOVED_PERMANENTLY )
707
+ self .assertEqual (response .getheader ("Location" ), self .base_url + "/" )
699
708
self .assertEqual (response .getheader ("Content-Length" ), "0" )
700
709
response = self .request (self .base_url + '/?hi=2' )
701
710
self .check_status_and_reason (response , HTTPStatus .OK )
@@ -801,6 +810,8 @@ def test_path_without_leading_slash(self):
801
810
self .check_status_and_reason (response , HTTPStatus .OK )
802
811
response = self .request (self .tempdir_name )
803
812
self .check_status_and_reason (response , HTTPStatus .MOVED_PERMANENTLY )
813
+ self .assertEqual (response .getheader ("Location" ),
814
+ self .tempdir_name + "/" )
804
815
response = self .request (self .tempdir_name + '/?hi=2' )
805
816
self .check_status_and_reason (response , HTTPStatus .OK )
806
817
response = self .request (self .tempdir_name + '?hi=1' )
0 commit comments