more debug

This commit is contained in:
Alexander Strizhakov 2020-04-07 10:19:44 +03:00
parent be9f90e755
commit e61add1a34
No known key found for this signature in database
GPG key ID: 022896A53AEF1381
2 changed files with 7 additions and 6 deletions

View file

@ -123,9 +123,6 @@ defmodule Pleroma.Plugs.RateLimiter do
do: !conn.assigns.remote_ip_found,
else: false
IO.inspect(localhost_or_socket, label: "localhost_or_socket")
IO.inspect(remote_ip_not_found, label: "remote_ip_not_found")
IO.inspect(Map.get(conn.assigns, :remote_ip_found), label: "remote_ip_found")
localhost_or_socket and remote_ip_not_found
end

View file

@ -31,11 +31,15 @@ defmodule Pleroma.Plugs.RemoteIp do
def call(%{remote_ip: original_remote_ip} = conn, _) do
config = Pleroma.Config.get(__MODULE__, [])
IO.inspect(original_remote_ip, label: "original remote ip")
if Keyword.get(config, :enabled, false) do
%{remote_ip: new_remote_ip} = conn = RemoteIp.call(conn, remote_ip_opts(config))
IO.inspect(new_remote_ip, label: "new remote ip")
if original_remote_ip == new_remote_ip do
IO.inspect(conn.request_path, label: "path")
IO.inspect(conn.query_string, label: "query string")
IO.inspect(conn.req_headers, label: "headers")
end
assign(conn, :remote_ip_found, original_remote_ip != new_remote_ip)
else
conn