diff options
author | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2019-06-14 15:45:05 +0000 |
---|---|---|
committer | kaniini <nenolod@gmail.com> | 2019-06-14 15:45:05 +0000 |
commit | c2ca1f22a25d22d6d863406ed05b08c643e5824c (patch) | |
tree | bf75fc306788d784d74fb6ca617f3ddd27b75fd2 /lib/pleroma/reverse_proxy.ex | |
parent | b7fc722a2e9e93341229cb122aac605421782295 (diff) | |
download | pleroma-c2ca1f22a25d22d6d863406ed05b08c643e5824c.tar.gz |
it is changed in compile time
we can't change module attributes and endpoint settings in runtime
Diffstat (limited to 'lib/pleroma/reverse_proxy.ex')
-rw-r--r-- | lib/pleroma/reverse_proxy.ex | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/pleroma/reverse_proxy.ex b/lib/pleroma/reverse_proxy.ex index 285d57309..de0f6e1bc 100644 --- a/lib/pleroma/reverse_proxy.ex +++ b/lib/pleroma/reverse_proxy.ex @@ -146,7 +146,7 @@ defmodule Pleroma.ReverseProxy do Logger.debug("#{__MODULE__} #{method} #{url} #{inspect(headers)}") method = method |> String.downcase() |> String.to_existing_atom() - case :hackney.request(method, url, headers, "", hackney_opts) do + case hackney().request(method, url, headers, "", hackney_opts) do {:ok, code, headers, client} when code in @valid_resp_codes -> {:ok, code, downcase_headers(headers), client} @@ -196,7 +196,7 @@ defmodule Pleroma.ReverseProxy do duration, Keyword.get(opts, :max_read_duration, @max_read_duration) ), - {:ok, data} <- :hackney.stream_body(client), + {:ok, data} <- hackney().stream_body(client), {:ok, duration} <- increase_read_duration(duration), sent_so_far = sent_so_far + byte_size(data), :ok <- body_size_constraint(sent_so_far, Keyword.get(opts, :max_body_size)), @@ -377,4 +377,6 @@ defmodule Pleroma.ReverseProxy do defp increase_read_duration(_) do {:ok, :no_duration_limit, :no_duration_limit} end + + defp hackney, do: Pleroma.Config.get(:hackney, :hackney) end |