logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 9783e9cd8023533d05bf78e3db3375102a199fc0
parent d43d05005ae4e8b0f069111baee867492d4f0c52
Author: Mark Felder <feld@FreeBSD.org>
Date:   Tue,  6 Oct 2020 17:08:26 -0500

Add test for an entry without CIDR format

Diffstat:

Mtest/plugs/remote_ip_test.exs11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git 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