Commit 19a90077 authored by Alexander Strizhakov's avatar Alexander Strizhakov

was used with hackney

parent 32188279
......@@ -28,9 +28,7 @@ defmodule Pleroma.HTTP do
"""
def request(method, url, body \\ "", headers \\ [], options \\ []) do
try do
options =
process_request_options(options)
|> process_sni_options(url)
options = process_request_options(options)
adapter_gun? = Application.get_env(:tesla, :adapter) == Tesla.Adapter.Gun
......@@ -65,21 +63,6 @@ def request(method, url, body \\ "", headers \\ [], options \\ []) do
end
end
defp process_sni_options(options, nil), do: options
defp process_sni_options(options, url) do
uri = URI.parse(url)
host = uri.host |> to_charlist()
case uri.scheme do
"https" ->
options ++ [ssl: [server_name_indication: host]]
_ ->
options
end
end
def process_request_options(options) do
Keyword.merge(Pleroma.HTTP.Connection.options([]), options)
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment