File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,10 @@ def test_cookies(env)
4343 cookies = request . cookies
4444
4545 Rack ::Response . new . tap do |response |
46+ # Hex encode non-printable characters:
47+ value = env [ 'HTTP_COOKIE' ] . gsub ( /[^[:print:]]/ , &:ord )
48+ response . add_header ( 'x-http-cookie' , value )
49+
4650 cookies . each do |key , value |
4751 response . set_cookie ( key , value )
4852 end
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ def body(headers)
1515
1616 expect ( response . status ) . to be == 200
1717 expect ( response . headers ) . to have_keys (
18+ 'x-http-cookie' => be == [ 'a=1' ] ,
1819 'set-cookie' => be == [ 'a=1' ]
1920 )
2021ensure
@@ -26,6 +27,7 @@ def body(headers)
2627
2728 expect ( response . status ) . to be == 200
2829 expect ( response . headers ) . to have_keys (
30+ 'x-http-cookie' => be == [ 'a=1;b=2' ] ,
2931 'set-cookie' => be == [ "a=1" , "b=2" ]
3032 )
3133ensure
@@ -37,6 +39,7 @@ def body(headers)
3739
3840 expect ( response . status ) . to be == 200
3941 expect ( response . headers ) . to have_keys (
42+ 'x-http-cookie' => be == [ 'a=1;b=2' ] ,
4043 'set-cookie' => be == [ 'a=1' , 'b=2' ]
4144 )
4245ensure
You can’t perform that action at this time.
0 commit comments