module Plugin::TCo

Constants

SHRINKED_MATCHER

Public Instance Methods

expand_url(url) click to toggle source
# File core/plugin/tco/tco.rb, line 12
def expand_url(url)
  no_mainthread
  begin
    res = Timeout.timeout(5){ Net::HTTP.get_response(URI.parse(url)) }
    if res.is_a?(Net::HTTPRedirection)
      res["location"]
    else
      url end
  rescue Exception => e
    warn e
    url end end