projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Downgrade Plug to 1.10.x, revert upload_limit tuple to function change
[akkoma]
/
test
/
pleroma
/
web
/
plugs
/
remote_ip_test.exs
diff --git
a/test/pleroma/web/plugs/remote_ip_test.exs
b/test/pleroma/web/plugs/remote_ip_test.exs
index b7fc24db0e5ea0b16ffcb349be847b310537550a..4d98de2bd73059ca49ee2b74c61b64d4a6907a78 100644
(file)
--- a/
test/pleroma/web/plugs/remote_ip_test.exs
+++ b/
test/pleroma/web/plugs/remote_ip_test.exs
@@
-26,7
+26,7
@@
defmodule Pleroma.Web.Plugs.RemoteIpTest do
)
test "disabled" do
)
test "disabled" do
-
Pleroma.Config.put
(RemoteIp, enabled: false)
+
clear_config
(RemoteIp, enabled: false)
%{remote_ip: remote_ip} = conn(:get, "/")
%{remote_ip: remote_ip} = conn(:get, "/")
@@
-48,7
+48,7
@@
defmodule Pleroma.Web.Plugs.RemoteIpTest do
end
test "custom headers" 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, "/")
conn =
conn(:get, "/")
@@
-73,7
+73,7
@@
defmodule Pleroma.Web.Plugs.RemoteIpTest do
refute conn.remote_ip == {1, 1, 1, 1}
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, "/")
conn =
conn(:get, "/")
@@
-84,7
+84,7
@@
defmodule Pleroma.Web.Plugs.RemoteIpTest do
end
test "proxies set without CIDR format" 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, "/")
conn =
conn(:get, "/")
@@
-95,8
+95,8
@@
defmodule Pleroma.Web.Plugs.RemoteIpTest do
end
test "proxies set `nonsensical` CIDR" 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, "/")
conn =
conn(:get, "/")