Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: crawler.rb
- ===================================================================
- --- crawler.rb (revision 153)
- +++ crawler.rb (working copy)
- @@ -82,8 +82,9 @@
- @session.cookies.from_header(res['set-cookie']) if res.key?('set-cookie')
- case res
- - when Net::HTTPRedirection : res = fetch(res['location'], {}, headers)
- - else
- + when Net::HTTPRedirection
- + @session.base_uris[-1] = @session.absolute_uri(res['location'])
- + res = fetch(res['location'], {}, headers)
- end
- post.empty? and @cache.update(uri, res.body)
- Index: session.rb
- ===================================================================
- --- session.rb (revision 153)
- +++ session.rb (working copy)
- @@ -46,6 +46,9 @@
- attr_reader :crawler
- ################################################################################
- + attr_reader :base_uris
- +
- + ################################################################################
- # Start a session using a HTTP GET
- def self.from_get (uri, &block)
- session = self.new
Add Comment
Please, Sign In to add comment