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

Merge pull request #214 from frohoff/master

fix for logging error with urls containing "%"
This commit is contained in:
Andy Brody 2014-03-28 00:52:11 -07:00
commit 94b35789e3

View file

@ -265,11 +265,11 @@ module RestClient
size += chunk.size
if RestClient.log
if size == 0
RestClient.log << "#{@method} #{@url} done (0 length file\n)"
RestClient.log << "%s %s done (0 length file\n)" % [@method, @url]
elsif total == 0
RestClient.log << "#{@method} #{@url} (zero content length)\n"
RestClient.log << "%s %s (zero content length)\n" % [@method, @url]
else
RestClient.log << "#{@method} #{@url} %d%% done (%d of %d)\n" % [(size * 100) / total, size, total]
RestClient.log << "%s %s %d%% done (%d of %d)\n" % [@method, @url, (size * 100) / total, size, total]
end
end
end