@@ -581,10 +581,19 @@ def test_get(self):
581
581
# check for trailing "/" which should return 404. See Issue17324
582
582
response = self .request (self .base_url + '/test/' )
583
583
self .check_status_and_reason (response , HTTPStatus .NOT_FOUND )
584
+ response = self .request (self .base_url + '/test%2f' )
585
+ self .check_status_and_reason (response , HTTPStatus .NOT_FOUND )
586
+ response = self .request (self .base_url + '/test%2F' )
587
+ self .check_status_and_reason (response , HTTPStatus .NOT_FOUND )
584
588
response = self .request (self .base_url + '/' )
585
589
self .check_status_and_reason (response , HTTPStatus .OK )
590
+ response = self .request (self .base_url + '%2f' )
591
+ self .check_status_and_reason (response , HTTPStatus .OK )
592
+ response = self .request (self .base_url + '%2F' )
593
+ self .check_status_and_reason (response , HTTPStatus .OK )
586
594
response = self .request (self .base_url )
587
595
self .check_status_and_reason (response , HTTPStatus .MOVED_PERMANENTLY )
596
+ self .assertEqual (response .getheader ("Location" ), self .base_url + "/" )
588
597
self .assertEqual (response .getheader ("Content-Length" ), "0" )
589
598
response = self .request (self .base_url + '/?hi=2' )
590
599
self .check_status_and_reason (response , HTTPStatus .OK )
@@ -690,6 +699,8 @@ def test_path_without_leading_slash(self):
690
699
self .check_status_and_reason (response , HTTPStatus .OK )
691
700
response = self .request (self .tempdir_name )
692
701
self .check_status_and_reason (response , HTTPStatus .MOVED_PERMANENTLY )
702
+ self .assertEqual (response .getheader ("Location" ),
703
+ self .tempdir_name + "/" )
693
704
response = self .request (self .tempdir_name + '/?hi=2' )
694
705
self .check_status_and_reason (response , HTTPStatus .OK )
695
706
response = self .request (self .tempdir_name + '?hi=1' )
0 commit comments