X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Fpleroma%2Fweb%2Fplugs%2Fremote_ip_test.exs;h=4d98de2bd73059ca49ee2b74c61b64d4a6907a78;hb=a851a24036e07db99f9d893ec9043f0d826ca877;hp=0bdb4c168757618578be6980d2ae0e3b34905d67;hpb=755f58168bb2b6b979c6f5d36f7eff56d2305911;p=akkoma
diff --git a/test/pleroma/web/plugs/remote_ip_test.exs b/test/pleroma/web/plugs/remote_ip_test.exs
index 0bdb4c168..4d98de2bd 100644
--- a/test/pleroma/web/plugs/remote_ip_test.exs
+++ b/test/pleroma/web/plugs/remote_ip_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Plugs.RemoteIpTest do
@@ -26,7 +26,7 @@ defmodule Pleroma.Web.Plugs.RemoteIpTest do
)
test "disabled" do
- Pleroma.Config.put(RemoteIp, enabled: false)
+ clear_config(RemoteIp, enabled: false)
%{remote_ip: remote_ip} = conn(:get, "/")
@@ -48,7 +48,7 @@ defmodule Pleroma.Web.Plugs.RemoteIpTest do
end
test "custom headers" do
- Pleroma.Config.put(RemoteIp, enabled: true, headers: ["cf-connecting-ip"])
+ clear_config(RemoteIp, enabled: true, headers: ["cf-connecting-ip"])
conn =
conn(:get, "/")
@@ -73,7 +73,7 @@ defmodule Pleroma.Web.Plugs.RemoteIpTest do
refute conn.remote_ip == {1, 1, 1, 1}
- Pleroma.Config.put([RemoteIp, :proxies], ["173.245.48.0/20"])
+ clear_config([RemoteIp, :proxies], ["173.245.48.0/20"])
conn =
conn(:get, "/")
@@ -84,7 +84,7 @@ defmodule Pleroma.Web.Plugs.RemoteIpTest do
end
test "proxies set without CIDR format" do
- Pleroma.Config.put([RemoteIp, :proxies], ["173.245.48.1"])
+ clear_config([RemoteIp, :proxies], ["173.245.48.1"])
conn =
conn(:get, "/")
@@ -95,8 +95,8 @@ defmodule Pleroma.Web.Plugs.RemoteIpTest do
end
test "proxies set `nonsensical` CIDR" do
- Pleroma.Config.put([RemoteIp, :reserved], ["127.0.0.0/8"])
- Pleroma.Config.put([RemoteIp, :proxies], ["10.0.0.3/24"])
+ clear_config([RemoteIp, :reserved], ["127.0.0.0/8"])
+ clear_config([RemoteIp, :proxies], ["10.0.0.3/24"])
conn =
conn(:get, "/")