removes saved headers from param defaults
This commit is contained in:
parent
73d25abefe
commit
1311dec8a3
1 changed files with 2 additions and 2 deletions
|
@ -6,13 +6,13 @@ module Microformats2
|
||||||
@http_headers = {}
|
@http_headers = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
def parse(html, headers=@http_headers)
|
def parse(html, headers={})
|
||||||
html = read_html(html, headers)
|
html = read_html(html, headers)
|
||||||
document = Nokogiri::HTML(html)
|
document = Nokogiri::HTML(html)
|
||||||
Collection.new(document).parse
|
Collection.new(document).parse
|
||||||
end
|
end
|
||||||
|
|
||||||
def read_html(html, headers=@http_headers)
|
def read_html(html, headers={})
|
||||||
open(html, headers) do |response|
|
open(html, headers) do |response|
|
||||||
@http_headers = response.meta if response.respond_to?(:meta)
|
@http_headers = response.meta if response.respond_to?(:meta)
|
||||||
@http_body = response.read
|
@http_body = response.read
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue