summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/rbot/plugins/url.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/data/rbot/plugins/url.rb b/data/rbot/plugins/url.rb
index f3eb3a7f..978bea6b 100644
--- a/data/rbot/plugins/url.rb
+++ b/data/rbot/plugins/url.rb
@@ -76,6 +76,11 @@ class UrlPlugin < Plugin
unless @bot.config['url.titles_only']
# content doesn't have title, just display info.
size = response['content-length'].gsub(/(\d)(?=\d{3}+(?:\.|$))(\d{3}\..*)?/,'\1,\2') rescue nil
+ if response.code == '206'
+ if response['content-range'] =~ /bytes\s*[^\/]+\/(\d+)/
+ size = $1
+ end
+ end
size = size ? ", size: #{size} bytes" : ""
return "type: #{response['content-type']}#{size}#{extra}"
end