Skip to content

Commit

Permalink
Fix Elixir 1.14 warnings (#207)
Browse files Browse the repository at this point in the history
* Fix Elixir 1.14 warnings

* Conditionally define module that uses :hackney

* Avoid Elixir :hackney warning by dynamic function call
  • Loading branch information
wpiekutowski authored Jul 31, 2023
1 parent 93cb91a commit 83a0b3e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :exvcr, [
global_mock: false,
Expand Down
2 changes: 1 addition & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :exvcr, [
global_mock: System.get_env("GLOBAL_MOCK") == "true"
Expand Down
4 changes: 3 additions & 1 deletion lib/exvcr/adapter/hackney/converter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ defmodule ExVCR.Adapter.Hackney.Converter do
end

def parse_request_body({:form, body}) do
:hackney_request.encode_form(body)
hackney_request_module().encode_form(body)
|> elem(2)
|> to_string
|> ExVCR.Filter.filter_sensitive_data()
end

def parse_request_body(body), do: super(body)

defp hackney_request_module(), do: :hackney_request
end

0 comments on commit 83a0b3e

Please sign in to comment.