Skip to content

Commit

Permalink
Ensure we don't pass both sameSite and same_site when adding cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed Mar 18, 2020
1 parent ea9407b commit bed0e21
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions rb/lib/selenium/webdriver/common/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ def add_cookie(opts = {})

opts[:path] ||= '/'
opts[:secure] ||= false
opts[:sameSite] = opts[:same_site] if opts[:same_site]

same_site = opts.delete(:same_site)
opts[:sameSite] = same_site if same_site

obj = opts.delete(:expires)
opts[:expiry] = seconds_from(obj).to_i if obj

Expand Down Expand Up @@ -170,8 +173,8 @@ def convert_cookie(cookie)
path: cookie['path'],
domain: cookie['domain'] && strip_port(cookie['domain']),
expires: cookie['expiry'] && datetime_at(cookie['expiry']),
secure: cookie['secure'],
same_site: cookie['sameSite']
same_site: cookie['sameSite'],
secure: cookie['secure']
}
end
end # Options
Expand Down

0 comments on commit bed0e21

Please sign in to comment.