Method: Mechanize::HTTP::Agent#get_meta_refresh
- Defined in:
- lib/mechanize/http/agent.rb
permalink #get_meta_refresh(response, uri, page) ⇒ Object
:section: Response
788 789 790 791 792 793 794 795 796 797 798 799 800 801 |
# File 'lib/mechanize/http/agent.rb', line 788 def response, uri, page return nil unless @follow_meta_refresh if page.respond_to?(:meta_refresh) and (redirect = page..first) then [redirect.delay, redirect.href] unless not @follow_meta_refresh_self and redirect.link_self elsif refresh = response['refresh'] delay, href, link_self = Mechanize::Page::MetaRefresh.parse refresh, uri raise Mechanize::Error, 'Invalid refresh http header' unless delay [delay.to_f, href] unless not @follow_meta_refresh_self and link_self end end |