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:
parent
e4430c10f3
commit
c6a2265f93
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue