Skip to content

Commit

Permalink
Don't pass headers to Rack with nil or non-string values.
Browse files Browse the repository at this point in the history
Closes #35
  • Loading branch information
SebastianEdwards authored and mislav committed Jul 7, 2015
1 parent 5902d56 commit bcc9f9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/faraday_middleware/rack_compatible.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def restore_env(rack_env)
headers.clear

rack_env.each do |name, value|
next unless String === name
next unless String === name && String === value
if NonPrefixedHeaders.include? name or name.index('HTTP_') == 0
name = name.sub(/^HTTP_/, '').downcase.tr('_', '-')
headers[name] = value
Expand Down

0 comments on commit bcc9f9b

Please sign in to comment.