@@ -581,10 +581,19 @@ def test_get(self):
581581 # check for trailing "/" which should return 404. See Issue17324
582582 response = self .request (self .base_url + '/test/' )
583583 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 )
584588 response = self .request (self .base_url + '/' )
585589 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 )
586594 response = self .request (self .base_url )
587595 self .check_status_and_reason (response , HTTPStatus .MOVED_PERMANENTLY )
596+ self .assertEqual (response .getheader ("Location" ), self .base_url + "/" )
588597 self .assertEqual (response .getheader ("Content-Length" ), "0" )
589598 response = self .request (self .base_url + '/?hi=2' )
590599 self .check_status_and_reason (response , HTTPStatus .OK )
@@ -690,6 +699,8 @@ def test_path_without_leading_slash(self):
690699 self .check_status_and_reason (response , HTTPStatus .OK )
691700 response = self .request (self .tempdir_name )
692701 self .check_status_and_reason (response , HTTPStatus .MOVED_PERMANENTLY )
702+ self .assertEqual (response .getheader ("Location" ),
703+ self .tempdir_name + "/" )
693704 response = self .request (self .tempdir_name + '/?hi=2' )
694705 self .check_status_and_reason (response , HTTPStatus .OK )
695706 response = self .request (self .tempdir_name + '?hi=1' )
0 commit comments