logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/

tzdata.ex (747B)


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