1
0
Fork 0
mirror of https://github.com/rest-client/rest-client.git synced 2022-11-09 13:49:40 -05:00

Fixing the response_log method to report the size on raw requests

This commit is contained in:
Adam Jacob 2009-03-16 16:59:12 -07:00
parent e4430c10f3
commit c6a2265f93

View file

@ -205,7 +205,8 @@ module RestClient
end
def response_log(res)
"# => #{res.code} #{res.class.to_s.gsub(/^Net::HTTP/, '')} | #{(res['Content-type'] || '').gsub(/;.*$/, '')} #{(res.body) ? res['Content-Length'].to_i : nil} bytes"
size = @raw_response ? File.size(@tf.path) : res.body.size
"# => #{res.code} #{res.class.to_s.gsub(/^Net::HTTP/, '')} | #{(res['Content-type'] || '').gsub(/;.*$/, '')} #{size} bytes"
end
def display_log(msg)