mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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
|
end
|
||||||
|
|
||||||
def self.force_custom_user_agent_hosts
|
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
|
end
|
||||||
|
|
||||||
def self.allowed_post_types
|
def self.allowed_post_types
|
||||||
|
@ -3,10 +3,6 @@
|
|||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
describe Oneboxer do
|
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
|
it "returns blank string for an invalid onebox" do
|
||||||
stub_request(:head, "http://boom.com")
|
stub_request(:head, "http://boom.com")
|
||||||
stub_request(:get, "http://boom.com").to_return(body: "")
|
stub_request(:get, "http://boom.com").to_return(body: "")
|
||||||
@ -174,6 +170,7 @@ describe Oneboxer do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "uses the Onebox custom user agent on specified hosts" do
|
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'
|
url = 'https://video.discourse.org/presentation.mp4'
|
||||||
|
|
||||||
stub_request(:head, url).to_return(status: 403, body: "", headers: {})
|
stub_request(:head, url).to_return(status: 403, body: "", headers: {})
|
||||||
|
Loading…
Reference in New Issue
Block a user