Skip to content

Commit

Permalink
Merge pull request #1 from DefactoSoftware/arnold/update-exconstructor
Browse files Browse the repository at this point in the history
update exconstructor. fix errors and warnings
  • Loading branch information
zwippie authored May 1, 2024
2 parents 9c9f268 + 939c357 commit 4b1de24
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
use Mix.Config
import Config

# This configuration is loaded before any dependency and is restricted
# to this project. If another project depends on this project, this
Expand Down
5 changes: 3 additions & 2 deletions lib/oembed/provider.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ defmodule OEmbed.Provider do

@behaviour OEmbed.Provider
@default_opts [follow_redirect: true, ssl: [{:versions, [:"tlsv1.2"]}]]
@request_opts Application.compile_env(:oembed, :request_opts, [])

defp get_oembed(url) do
opts =
@default_opts
|> Keyword.merge(Application.compile_env(:oembed, :request_opts))
|> Keyword.merge(@request_opts)

with {:ok, %HTTPoison.Response{body: body}} <-
HTTPoison.get(url, [], opts),
Expand All @@ -39,5 +40,5 @@ defmodule OEmbed.Provider do
end

@callback provides?(String.t()) :: boolean
@callback get(String.t()) :: struct
@callback get(String.t()) :: {:ok, String.t()} | {:error, String.t()}
end
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule OEmbed.Mixfile do
use Mix.Project

@version "0.4.1"
@version "0.4.2"

def project do
[
Expand Down Expand Up @@ -41,7 +41,7 @@ defmodule OEmbed.Mixfile do
{:httpoison, ">= 0.9.0"},
{:floki, ">= 0.24.0"},
{:poison, ">= 1.5.0"},
{:exconstructor, ">= 1.0.0"},
{:exconstructor, "~> 1.2.13"},
{:exvcr, "~> 0.12", only: :test},
{:inch_ex, ">= 0.0.0", only: :docs},
{:earmark, ">= 0.0.0", only: :dev},
Expand Down

0 comments on commit 4b1de24

Please sign in to comment.