Use finch everywhere (#33)
[akkoma] / lib / pleroma / http / tzdata.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.HTTP.Tzdata do
6 @moduledoc false
7
8 @behaviour Tzdata.HTTPClient
9
10 alias Pleroma.HTTP
11
12 @impl true
13 def get(url, headers, options) do
14 with {:ok, %Tesla.Env{} = env} <- HTTP.get(url, headers, options) do
15 {:ok, {env.status, env.headers, env.body}}
16 end
17 end
18
19 @impl true
20 def head(url, headers, options) do
21 with {:ok, %Tesla.Env{} = env} <- HTTP.head(url, headers, options) do
22 {:ok, {env.status, env.headers}}
23 end
24 end
25 end