Skip to content

Commit df3647d

Browse files
committed
[1.8 compatibility] there is no #each_with_object
1 parent 7995618 commit df3647d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ Style/Lambda:
1313

1414
Style/TrailingComma:
1515
EnforcedStyleForMultiline: no_comma
16+
17+
Style/EachWithObject:
18+
Enabled: false

lib/rack_reverse_proxy/middleware.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,10 @@ def reverse_proxy(matcher, url = nil, opts = {})
144144
end
145145

146146
def format_headers(headers)
147-
headers.each_with_object({}) do |(key, val), acc|
147+
headers.inject({}) do |acc, (key, val)|
148148
formated_key = key.split("-").map(&:capitalize).join("-")
149149
acc[formated_key] = Array(val)
150+
acc
150151
end
151152
end
152153
end

0 commit comments

Comments
 (0)