@@ -1569,7 +1569,7 @@ def test_response_redirect_to_cross_site_with_credential
15691569 refute_includes ( headers . keys , "AUTHORIZATION" )
15701570 refute_includes ( headers . keys , "cookie" )
15711571
1572- assert_match ' range|bytes=0-9999' , page . body
1572+ assert_match ( " range|bytes=0-9999" , page . body )
15731573 refute_match ( "authorization|Basic xxx" , page . body )
15741574 refute_match ( "cookie|name=value" , page . body )
15751575 end
@@ -1590,11 +1590,32 @@ def test_response_redirect_to_same_site_with_credential
15901590 assert_includes ( headers . keys , "AUTHORIZATION" )
15911591 assert_includes ( headers . keys , "cookie" )
15921592
1593- assert_match ' range|bytes=0-9999' , page . body
1593+ assert_match ( " range|bytes=0-9999" , page . body )
15941594 assert_match ( "authorization|Basic xxx" , page . body )
15951595 assert_match ( "cookie|name=value" , page . body )
15961596 end
15971597
1598+ def test_response_redirect_to_same_site_diff_port_with_credential
1599+ @agent . redirect_ok = true
1600+
1601+ headers = {
1602+ 'Range' => 'bytes=0-9999' ,
1603+ 'AUTHORIZATION' => 'Basic xxx' ,
1604+ 'cookie' => 'name=value' ,
1605+ }
1606+
1607+ page = html_page ''
1608+ page = @agent . response_redirect ( { 'Location' => 'http://example:81/http_headers' } , :get ,
1609+ page , 0 , headers )
1610+
1611+ refute_includes ( headers . keys , "AUTHORIZATION" )
1612+ assert_includes ( headers . keys , "cookie" )
1613+
1614+ assert_match ( "range|bytes=0-9999" , page . body )
1615+ refute_match ( "authorization|Basic xxx" , page . body )
1616+ assert_match ( "cookie|name=value" , page . body )
1617+ end
1618+
15981619 def test_response_redirect_not_ok
15991620 @agent . redirect_ok = false
16001621
0 commit comments