lib/parliament/request/open_search_request.rb in parliament-opensearch-0.2.3 vs lib/parliament/request/open_search_request.rb in parliament-opensearch-0.2.4

- old
+ new

@@ -73,10 +73,10 @@ request = Parliament::Request::BaseRequest.new(base_url: url, headers: {'Accept' => 'application/opensearchdescription+xml'}) xml_response = request.get begin - xml_root = REXML::Document.new(xml_response.body).root + xml_root = REXML::Document.new(xml_response.response.body).root template = xml_root.elements['Url'].attributes['template'] raise Parliament::OpenSearch::DescriptionError.new(url), "The document found does not contain a require node. Attempted to get a 'Url' element with the attribute 'template'. Please check the description document at '#{url}' and try again." if template.nil? rescue NoMethodError raise Parliament::OpenSearch::DescriptionError.new(url), "The document found does not appear to be XML. Please check the description document at '#{url}' and try again."