mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 07:26:04 +08:00
27 lines
426 B
Ruby
27 lines
426 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module Onebox
|
||
|
module Engine
|
||
|
module HTML
|
||
|
private
|
||
|
|
||
|
# Overwrite for any custom headers
|
||
|
def http_params
|
||
|
{}
|
||
|
end
|
||
|
|
||
|
def raw
|
||
|
@raw ||= Onebox::Helpers.fetch_html_doc(url, http_params, body_cacher)
|
||
|
end
|
||
|
|
||
|
def body_cacher
|
||
|
self.options&.[](:body_cacher)
|
||
|
end
|
||
|
|
||
|
def html?
|
||
|
raw.respond_to(:css)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|