Skip to content

Commit

Permalink
Update remember_token_cookies
Browse files Browse the repository at this point in the history
Apparently the value might be a string or an array depending on the
version of ActionDispatch.
  • Loading branch information
sej3506 committed Dec 8, 2023
1 parent 2c21d62 commit 04747b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/support/request_with_remember_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ def request_without_remember_token

def remember_token_cookies
cookies = headers["Set-Cookie"] || headers["set-cookie"]
cookie_lines = cookies.lines.map(&:chomp)
if cookies.is_a?(String)
cookie_lines = cookies.lines.map(&:chomp)
else
cookie_lines = cookies
end
cookie_lines.select { |name| name =~ /^remember_token/ }
end
end
Expand Down

0 comments on commit 04747b9

Please sign in to comment.