lib/wayfarer/page.rb in wayfarer-0.4.1 vs lib/wayfarer/page.rb in wayfarer-0.4.2
- old
+ new
@@ -18,10 +18,10 @@
return @doc if @doc
# If no Content-Type field is present, assume HTML/XML
return @doc = Wayfarer::Parsing::XML.parse_html(body) unless headers["content-type"]
- content_type = headers["content-type"].first
+ content_type = headers["content-type"]
sub_type = MIME::Types[content_type].first.sub_type
@doc = case sub_type
when "json" then Wayfarer::Parsing::JSON.parse(body)
when "xml" then Wayfarer::Parsing::XML.parse_xml(body)