Skip to content

Commit d1db80f

Browse files
committed
Fix tests
1 parent 7dde3bb commit d1db80f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/mint/http.ex

+8-1
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ defmodule Mint.HTTP do
939939
body: binary()
940940
}
941941
def request_and_response(conn, method, path, headers, body, options \\ []) do
942-
options = Keyword.validate!(options, timeout: :infinity)
942+
options = keyword_validate!(options, timeout: :infinity)
943943

944944
with {:ok, conn, ref} <- request(conn, method, path, headers, body) do
945945
recv_response(conn, ref, options[:timeout])
@@ -1008,6 +1008,13 @@ defmodule Mint.HTTP do
10081008
end
10091009
end
10101010

1011+
# TODO: Remove when we require Elixir v1.13
1012+
if Version.match?(System.version(), ">= 1.13") do
1013+
defp keyword_validate!(keyword, values), do: Keyword.validate!(keyword, validate)
1014+
else
1015+
defp keyword_validate!(keyword, _values), do: keyword
1016+
end
1017+
10111018
@doc """
10121019
Changes the mode of the underlying socket.
10131020

0 commit comments

Comments
 (0)