make httppoison use configurable http proxy

This commit is contained in:
Jeff Becker 2017-12-30 11:35:53 -05:00
commit 5ddd15d794
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05
2 changed files with 18 additions and 1 deletions

14
lib/pleroma/http/http.ex Normal file
View file

@ -0,0 +1,14 @@
defmodule Pleroma.HTTP do
use HTTPoison.Base
def process_request_options(options) do
config = Application.get_env(:pleroma, :http, [])
proxy = Keyword.get(config, :proxy_url, "")
case proxy do
"" -> options
_ -> options ++ [proxy: proxy]
end
end
end