Skip to content

Commit

Permalink
Fixes an edge-case issue with response headers parsing (missing HTTP …
Browse files Browse the repository at this point in the history
…header) (#719)

Fixes #681 (comment)
  • Loading branch information
iMacTia authored Aug 11, 2017
1 parent f8892b1 commit ad7a8e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/faraday/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def parse(header_string)
headers = header_string.split(/\r\n/)

# Find the last set of response headers.
start_index = headers.rindex { |x| x.match(/^HTTP\//) }
start_index = headers.rindex { |x| x.match(/^HTTP\//) } || 0
last_response = headers.slice(start_index, headers.size)

last_response.
Expand Down

0 comments on commit ad7a8e5

Please sign in to comment.