projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d43d050
)
Add test for an entry without CIDR format
author
Mark Felder
<feld@FreeBSD.org>
Tue, 6 Oct 2020 22:08:26 +0000
(17:08 -0500)
committer
Mark Felder
<feld@FreeBSD.org>
Tue, 6 Oct 2020 22:08:26 +0000
(17:08 -0500)
test/plugs/remote_ip_test.exs
patch
|
blob
|
history
diff --git
a/test/plugs/remote_ip_test.exs
b/test/plugs/remote_ip_test.exs
index 2dd1ac1f865ae1a01a1676a171eb2dda7305d009..849c7fc3da4fea6e8ed30d502ecfb05cacb5f19c 100644
(file)
--- a/
test/plugs/remote_ip_test.exs
+++ b/
test/plugs/remote_ip_test.exs
@@
-82,4
+82,15
@@
defmodule Pleroma.Plugs.RemoteIpTest do
assert conn.remote_ip == {1, 1, 1, 1}
end
+
+ test "proxies set without CIDR format" do
+ Pleroma.Config.put([RemoteIp, :proxies], ["173.245.48.1"])
+
+ conn =
+ conn(:get, "/")
+ |> put_req_header("x-forwarded-for", "173.245.48.1, 1.1.1.1")
+ |> RemoteIp.call(nil)
+
+ assert conn.remote_ip == {1, 1, 1, 1}
+ end
end