Compare commits

...

4 Commits

Author SHA1 Message Date
Alexander Strizhakov
e61add1a34
more debug 2020-04-07 10:19:44 +03:00
Alexander Strizhakov
be9f90e755
http debug 2020-04-07 08:48:26 +03:00
Alexander Strizhakov
77c13aeecc
more debug 2020-04-06 16:14:31 +03:00
Alexander Strizhakov
bced14a225
debug remote ip 2020-04-06 16:14:30 +03:00
2 changed files with 12 additions and 0 deletions

View File

@ -55,6 +55,11 @@ defmodule Pleroma.HTTP do
@spec request(atom(), Request.url(), String.t(), Request.headers(), keyword()) :: @spec request(atom(), Request.url(), String.t(), Request.headers(), keyword()) ::
{:ok, Env.t()} | {:error, any()} {:ok, Env.t()} | {:error, any()}
def request(method, url, body, headers, options) when is_binary(url) do 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) uri = URI.parse(url)
adapter_opts = Connection.options(uri, options[:adapter] || []) adapter_opts = Connection.options(uri, options[:adapter] || [])
options = put_in(options[:adapter], adapter_opts) options = put_in(options[:adapter], adapter_opts)

View File

@ -33,6 +33,13 @@ defmodule Pleroma.Plugs.RemoteIp do
if Keyword.get(config, :enabled, false) do if Keyword.get(config, :enabled, false) do
%{remote_ip: new_remote_ip} = conn = RemoteIp.call(conn, remote_ip_opts(config)) %{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) assign(conn, :remote_ip_found, original_remote_ip != new_remote_ip)
else else
conn conn