Compare commits
4 Commits
feature/sa
...
debug-remo
Author | SHA1 | Date | |
---|---|---|---|
|
e61add1a34 | ||
|
be9f90e755 | ||
|
77c13aeecc | ||
|
bced14a225 |
@ -55,6 +55,11 @@ defmodule Pleroma.HTTP do
|
||||
@spec request(atom(), Request.url(), String.t(), Request.headers(), keyword()) ::
|
||||
{:ok, Env.t()} | {:error, any()}
|
||||
def request(method, url, body, headers, options) when is_binary(url) do
|
||||
if String.starts_with?(url, Pleroma.Web.base_url()) do
|
||||
Logger.warn("Request is called with local URL -> #{url}")
|
||||
Logger.warn("Backtrace: #{inspect(Process.info(:erlang.self(), :current_stacktrace))}")
|
||||
end
|
||||
|
||||
uri = URI.parse(url)
|
||||
adapter_opts = Connection.options(uri, options[:adapter] || [])
|
||||
options = put_in(options[:adapter], adapter_opts)
|
||||
|
@ -33,6 +33,13 @@ defmodule Pleroma.Plugs.RemoteIp do
|
||||
|
||||
if Keyword.get(config, :enabled, false) do
|
||||
%{remote_ip: new_remote_ip} = conn = RemoteIp.call(conn, remote_ip_opts(config))
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user