X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fcore%2Futils%2Futils.rb;h=535ae190179c1bfbfa577a180d42baa24014f079;hb=a209adb0e00e2a335333c1cb696d5807a47072c6;hp=faf42b63b4c25571941ebcec72779607e405dcd5;hpb=7dc90478a90c43ae1dde9332cc5e1ee282727f4e;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/core/utils/utils.rb b/lib/rbot/core/utils/utils.rb index faf42b63..535ae190 100644 --- a/lib/rbot/core/utils/utils.rb +++ b/lib/rbot/core/utils/utils.rb @@ -505,9 +505,6 @@ module ::Irc when Net::HTTPResponse Utils.get_resp_html_info(doc, opts) when URI - if doc.fragment and not doc.fragment.empty? - opts[:uri_fragment] ||= doc.fragment - end ret = Hash.new @@bot.httputil.get_response(doc) { |resp| ret = Utils.get_resp_html_info(resp, opts) @@ -543,6 +540,10 @@ module ::Irc partial = resp.partial_body(@@bot.config['http.info_bytes']) if resp['content-type'] =~ /^text\/|(?:x|ht)ml/ + loc = URI.parse(resp['x-rbot-location'] || resp['location']) rescue nil + if loc and loc.fragment and not loc.fragment.empty? + opts[:uri_fragment] ||= loc.fragment + end ret.merge!(Utils.get_string_html_info(partial, opts)) end return ret