diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-05-11 23:21:53 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-05-11 23:21:53 +0300 |
commit | 1b23acf164ebc4fde3fe1e4fdca6e11b7caa90ef (patch) | |
tree | 12209d990aee365c7df0c64b94eabf3b236f8066 /lib/pleroma/reverse_proxy/reverse_proxy.ex | |
parent | bbdad8556861c60ae1f526f63de9c5857c4ad547 (diff) | |
download | pleroma-1b23acf164ebc4fde3fe1e4fdca6e11b7caa90ef.tar.gz |
[#2497] Media preview proxy for images: fixes, tweaks, refactoring, tests adjustments.
Diffstat (limited to 'lib/pleroma/reverse_proxy/reverse_proxy.ex')
-rw-r--r-- | lib/pleroma/reverse_proxy/reverse_proxy.ex | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pleroma/reverse_proxy/reverse_proxy.ex b/lib/pleroma/reverse_proxy/reverse_proxy.ex index 4bbeb493c..aeaf9bd39 100644 --- a/lib/pleroma/reverse_proxy/reverse_proxy.ex +++ b/lib/pleroma/reverse_proxy/reverse_proxy.ex @@ -16,6 +16,8 @@ defmodule Pleroma.ReverseProxy do @failed_request_ttl :timer.seconds(60) @methods ~w(GET HEAD) + def max_read_duration_default, do: @max_read_duration + @moduledoc """ A reverse proxy. @@ -370,6 +372,8 @@ defmodule Pleroma.ReverseProxy do defp body_size_constraint(_, _), do: :ok + defp check_read_duration(nil = _duration, max), do: check_read_duration(@max_read_duration, max) + defp check_read_duration(duration, max) when is_integer(duration) and is_integer(max) and max > 0 do if duration > max do |