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 @@ -45,6 +45,10 @@ def test_cookies(env)
4545 cookies = request . cookies
4646
4747 Rack ::Response . new . tap do |response |
48+ # Hex encode non-printable characters:
49+ value = env [ 'HTTP_COOKIE' ] . gsub ( /[^[:print:]]/ , &:ord )
50+ response . add_header ( 'x-http-cookie' , value )
51+
4852 cookies . each do |key , value |
4953 response . set_cookie ( key , value )
5054 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