Skip to content

Commit

Permalink
Merge pull request #1042 from RicardoTrindade/patch-1
Browse files Browse the repository at this point in the history
EmHttpRequestAdapter - Call detect instead of select..first
  • Loading branch information
bblimke authored Feb 4, 2024
2 parents 63940ac + 5c898ed commit 890d41e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/webmock/http_lib_adapters/em_http_request_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def get_response_cookie(name)
raw_cookie = response_header.cookie
raw_cookie = [raw_cookie] if raw_cookie.is_a? String

cookie = raw_cookie.select { |c| c.start_with? name }.first
cookie = raw_cookie.detect { |c| c.start_with? name }
cookie and cookie.split('=', 2)[1]
end

Expand Down

0 comments on commit 890d41e

Please # to comment.