summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-10-11 07:36:23 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-10-11 07:36:23 +0000
commit72cece8d09ae0f2835eed996e15ddfe3cb95045f (patch)
tree2950acb36dd401b6b7329b114119946d21b40705 /lib
parent1358de00a473092d1aad2f22e2a73f02ce80e160 (diff)
first_html_par: detect fragment at the right place
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/core/utils/utils.rb7
1 files changed, 4 insertions, 3 deletions
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