diff --git a/app/models/image.rb b/app/models/image.rb index eb898dce..ffd826fe 100644 --- a/app/models/image.rb +++ b/app/models/image.rb @@ -46,14 +46,12 @@ def register_in_redis end def internal_link? - uri = URI.parse(URI.encode link) + uri = URI.join(link) !uri.host || uri.host == MY_DOMAIN || uri.host == IMG_DOMAIN - rescue - true end def blacklisted? - uri = URI.parse(URI.encode link) + uri = URI.join(link) uri.host =~ /^(10|127|169\.254|192\.168)\./ end