@@ -504,10 +504,19 @@ def test_get(self):
504504        # check for trailing "/" which should return 404. See Issue17324 
505505        response  =  self .request (self .base_url  +  '/test/' )
506506        self .check_status_and_reason (response , HTTPStatus .NOT_FOUND )
507+         response  =  self .request (self .base_url  +  '/test%2f' )
508+         self .check_status_and_reason (response , HTTPStatus .NOT_FOUND )
509+         response  =  self .request (self .base_url  +  '/test%2F' )
510+         self .check_status_and_reason (response , HTTPStatus .NOT_FOUND )
507511        response  =  self .request (self .base_url  +  '/' )
508512        self .check_status_and_reason (response , HTTPStatus .OK )
513+         response  =  self .request (self .base_url  +  '%2f' )
514+         self .check_status_and_reason (response , HTTPStatus .OK )
515+         response  =  self .request (self .base_url  +  '%2F' )
516+         self .check_status_and_reason (response , HTTPStatus .OK )
509517        response  =  self .request (self .base_url )
510518        self .check_status_and_reason (response , HTTPStatus .MOVED_PERMANENTLY )
519+         self .assertEqual (response .getheader ("Location" ), self .base_url  +  "/" )
511520        self .assertEqual (response .getheader ("Content-Length" ), "0" )
512521        response  =  self .request (self .base_url  +  '/?hi=2' )
513522        self .check_status_and_reason (response , HTTPStatus .OK )
@@ -613,6 +622,8 @@ def test_path_without_leading_slash(self):
613622        self .check_status_and_reason (response , HTTPStatus .OK )
614623        response  =  self .request (self .tempdir_name )
615624        self .check_status_and_reason (response , HTTPStatus .MOVED_PERMANENTLY )
625+         self .assertEqual (response .getheader ("Location" ),
626+                          self .tempdir_name  +  "/" )
616627        response  =  self .request (self .tempdir_name  +  '/?hi=2' )
617628        self .check_status_and_reason (response , HTTPStatus .OK )
618629        response  =  self .request (self .tempdir_name  +  '?hi=1' )
0 commit comments