Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach committed Aug 14, 2024
1 parent 7dde3bb commit f307e26
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/mint/http.ex
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ defmodule Mint.HTTP do
body: binary()
}
def request_and_response(conn, method, path, headers, body, options \\ []) do
options = Keyword.validate!(options, timeout: :infinity)
options = keyword_validate!(options, timeout: :infinity)

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

# TODO: Remove when we require Elixir v1.13
if Version.match?(System.version(), ">= 1.13.0") do
defp keyword_validate!(keyword, values), do: Keyword.validate!(keyword, values)
else
defp keyword_validate!(keyword, _values), do: keyword
end

@doc """
Changes the mode of the underlying socket.
Expand Down

0 comments on commit f307e26

Please sign in to comment.