Use hijack in inline onebox controller

This commit is contained in:
Vinoth Kannan 2018-11-13 02:39:20 +05:30
parent 4f81bb8303
commit dda1824270
2 changed files with 5 additions and 2 deletions

View File

@ -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

View File

@ -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)