lib/mechanize.rb in mechanize-0.1.1 vs lib/mechanize.rb in mechanize-0.1.2

- old
+ new

@@ -4,11 +4,11 @@ # This is a quick hack, to get something like Perl's WWW::Mechanize. Sure, we # have Web::Unit, but, that does not work for me as expected, as it does not # set cookies (I might be wrong), does not automatically redirect and has # problems with some html documents. -Version = "0.1.1" +Version = "0.1.2" # required due to the missing get_fields method in Ruby 1.8.2 $LOAD_PATH.unshift File.join(File.dirname(__FILE__), "mechanize", "net-overrides") require 'net/http' require 'net/https' @@ -181,10 +181,10 @@ end private def parse_html - raise "no html" if content_type() != 'text/html' + raise "no html" unless content_type() =~ /^text\/html/ # construct parser and feed with HTML parser = HTMLTree::XMLParser.new begin parser.feed(@body)