DEV: do not persist force_custom_user_agent_hosts setting

Followup to f029e2
This commit is contained in:
Penar Musaraj 2020-02-06 11:56:54 -05:00
parent 6ba7f924ba
commit 4b6a47be48
2 changed files with 2 additions and 5 deletions

View File

@ -31,7 +31,7 @@ module Oneboxer
end
def self.force_custom_user_agent_hosts
@force_custom_user_agent_hosts ||= SiteSetting.force_custom_user_agent_hosts.split('|')
SiteSetting.force_custom_user_agent_hosts.split('|')
end
def self.allowed_post_types

View File

@ -3,10 +3,6 @@
require 'rails_helper'
describe Oneboxer do
before do
SiteSetting.force_custom_user_agent_hosts = "http://codepen.io|https://video.discourse.org/"
end
it "returns blank string for an invalid onebox" do
stub_request(:head, "http://boom.com")
stub_request(:get, "http://boom.com").to_return(body: "")
@ -174,6 +170,7 @@ describe Oneboxer do
end
it "uses the Onebox custom user agent on specified hosts" do
SiteSetting.force_custom_user_agent_hosts = "http://codepen.io|https://video.discourse.org/"
url = 'https://video.discourse.org/presentation.mp4'
stub_request(:head, url).to_return(status: 403, body: "", headers: {})