File tree Expand file tree Collapse file tree
lib/selenium/webdriver/common
spec/integration/selenium/webdriver Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ def add_cookie(opts = {})
5252 same_site = opts . delete ( :same_site )
5353 opts [ :sameSite ] = same_site if same_site
5454
55+ http_only = opts . delete ( :http_only )
56+ opts [ :httpOnly ] = http_only if http_only
57+
5558 obj = opts . delete ( :expires )
5659 opts [ :expiry ] = seconds_from ( obj ) . to_i if obj
5760
Original file line number Diff line number Diff line change @@ -55,6 +55,15 @@ module WebDriver
5555 describe 'cookie management' do
5656 after { driver . manage . delete_all_cookies }
5757
58+ it 'should show http only when insecure' do
59+ driver . navigate . to url_for ( 'xhtmlTest.html' )
60+ driver . manage . add_cookie name : 'security' ,
61+ value : 'insecure' ,
62+ http_only : true
63+
64+ expect ( driver . manage . cookie_named ( 'security' ) [ :http_only ] ) . to eq true
65+ end
66+
5867 it 'should not show secure when insecure' do
5968 driver . navigate . to url_for ( 'xhtmlTest.html' )
6069 driver . manage . add_cookie name : 'security' ,
You can’t perform that action at this time.
0 commit comments