formatting the code
This commit is contained in:
parent
5c6d47614d
commit
dd8aee332c
6 changed files with 57 additions and 16 deletions
|
|
@ -1,4 +1,8 @@
|
|||
defmodule Pleroma.HTTP.Connection do
|
||||
@moduledoc """
|
||||
Connection for http-requests.
|
||||
"""
|
||||
|
||||
@hackney_options [pool: :default]
|
||||
@adapter Application.get_env(:tesla, :adapter)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
defmodule Pleroma.HTTP do
|
||||
require HTTPoison
|
||||
alias Pleroma.HTTP.Connection
|
||||
alias Pleroma.HTTP.RequestBuilder, as: Builder
|
||||
|
||||
@doc """
|
||||
Builds and perform http request.
|
||||
"""
|
||||
def request(method, url, body \\ "", headers \\ [], options \\ []) do
|
||||
options =
|
||||
process_request_options(options)
|
||||
|
|
@ -19,6 +21,7 @@ defmodule Pleroma.HTTP do
|
|||
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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue