config: eliminate hostnames config option.

Eliminate the Danbooru.config.hostnames option. It was only used for
rewriting links in notes. Just using the main hostname is good enough,
there aren't any notes still using any of Danbooru's alternate domain
names.
This commit is contained in:
evazion
2020-01-11 00:59:25 -06:00
parent 9afce59790
commit 07a0b0b175
3 changed files with 2 additions and 8 deletions

View File

@@ -23,7 +23,7 @@ class NoteSanitizerTest < ActiveSupport::TestCase
end
should "rewrite absolute links to relative links" do
Danbooru.config.stubs(:hostnames).returns(%w[danbooru.donmai.us sonohara.donmai.us hijiribe.donmai.us])
Danbooru.config.stubs(:hostname).returns("sonohara.donmai.us")
body = '<a href="http://sonohara.donmai.us/posts?tags=touhou#dtext-intro">touhou</a>'
assert_equal('<a href="/posts?tags=touhou#dtext-intro" rel="external noreferrer nofollow">touhou</a>', NoteSanitizer.sanitize(body))