mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
Use hijack in inline onebox controller
This commit is contained in:
parent
4f81bb8303
commit
dda1824270
@ -4,7 +4,9 @@ class InlineOneboxController < ApplicationController
|
||||
requires_login
|
||||
|
||||
def show
|
||||
oneboxes = InlineOneboxer.new(params[:urls] || []).process
|
||||
render json: { "inline-oneboxes" => oneboxes }
|
||||
hijack do
|
||||
oneboxes = InlineOneboxer.new(params[:urls] || []).process
|
||||
render json: { "inline-oneboxes" => oneboxes }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -44,6 +44,7 @@ describe InlineOneboxer do
|
||||
SiteSetting.enable_inline_onebox_on_all_domains = true
|
||||
url = "https://example.com/random-url"
|
||||
|
||||
InlineOneboxer.purge(url)
|
||||
expect(InlineOneboxer.cache_lookup(url)).to be_blank
|
||||
|
||||
result = InlineOneboxer.lookup(url)
|
||||
|
Loading…
Reference in New Issue
Block a user