Fix instances of frozen empty string literals (#1040)

This commit is contained in:
Bobby McDonald 2019-10-17 06:25:15 -04:00 committed by Mattia
parent b5bbf1f2d2
commit e331955fd8
2 changed files with 3 additions and 3 deletions

View File

@ -59,7 +59,7 @@ module Faraday
end
save_response(env, http_response.code.to_i,
http_response.body || '', nil,
http_response.body || +'', nil,
http_response.message) do |response_headers|
http_response.each_header do |key, value|
response_headers[key] = value
@ -101,7 +101,7 @@ module Faraday
env[:request].on_data.call(chunk, size)
end
end
env[:request].on_data.call('', 0) unless yielded
env[:request].on_data.call(+'', 0) unless yielded
# Net::HTTP returns something,
# but it's not meaningful according to the docs.
http_response.body = nil

View File

@ -132,7 +132,7 @@ module Faraday
# Sets content length to zero and the body to the empty string.
def clear_body
request_headers[ContentLength] = '0'
self.body = ''
self.body = +''
end
# @return [Boolean] true if the status isn't in the set of