lib/www/mechanize/chain/response_header_handler.rb in mechanize-0.9.1 vs lib/www/mechanize/chain/response_header_handler.rb in mechanize-0.9.2

- old
+ new

@@ -24,11 +24,12 @@ k, v = option.split(/=/) cache_obj[:keep_alive_options] ||= {} cache_obj[:keep_alive_options][k.intern] = v end end - body = Util.to_native_charset(page.body) - if page.is_a?(Page) && body =~ /Set-Cookie/ + + + if page.is_a?(Page) && page.body =~ /Set-Cookie/n page.search('//meta[@http-equiv="Set-Cookie"]').each do |meta| Cookie::parse(uri, meta['content']) { |c| Mechanize.log.debug("saved cookie: #{c}") if Mechanize.log @cookie_jar.add(uri, c) }