diff --git a/lib/em-http/http_encoding.rb b/lib/em-http/http_encoding.rb index cf7e647..af198e6 100644 --- a/lib/em-http/http_encoding.rb +++ b/lib/em-http/http_encoding.rb @@ -126,7 +126,7 @@ def encode_auth(k,v) end def encode_headers(head) - head.inject('') do |result, (key, value)| + head.inject(String.new) do |result, (key, value)| # Munge keys from foo-bar-baz to Foo-Bar-Baz key = key.split('-').map { |k| k.to_s.capitalize }.join('-') result << case key @@ -140,7 +140,7 @@ def encode_headers(head) def encode_cookie(cookie) if cookie.is_a? Hash - cookie.inject('') { |result, (k, v)| result << encode_param(k, v) + ";" } + cookie.inject(String.new) { |result, (k, v)| result << encode_param(k, v) + ";" } else cookie end