mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 14:38:17 +08:00
Oneboxes shouldn't explode when the remote causes an HTTPError
This commit is contained in:
parent
921c3f016f
commit
702fbcdfa8
|
@ -42,7 +42,7 @@ module Oneboxer
|
|||
end
|
||||
(doc/"link[@type='text/json+oembed']").each do |oembed|
|
||||
return OembedOnebox.new(oembed[:href]).onebox
|
||||
end
|
||||
end
|
||||
|
||||
# Check for opengraph
|
||||
open_graph = Oneboxer.parse_open_graph(doc)
|
||||
|
@ -50,7 +50,9 @@ module Oneboxer
|
|||
end
|
||||
end
|
||||
|
||||
nil
|
||||
nil
|
||||
rescue OpenURI::HTTPError
|
||||
nil
|
||||
end
|
||||
|
||||
# Parse URLs out of HTML, returning the document when finished.
|
||||
|
|
Loading…
Reference in New Issue
Block a user