mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 09:12:45 +08:00
DEV: do not persist force_custom_user_agent_hosts setting
Followup to f029e2
This commit is contained in:
parent
6ba7f924ba
commit
4b6a47be48
|
@ -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
|
||||
|
|
|
@ -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: {})
|
||||
|
|
Loading…
Reference in New Issue
Block a user