Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/req/steps.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ defmodule Req.Steps do
conn =
Req.Test.Adapter.conn(%Plug.Conn{}, request.method, request.url, req_body)
|> Map.replace!(:req_headers, req_headers)
|> Plug.Conn.fetch_query_params()
|> Plug.Conn.fetch_query_params(validate_utf8: false)
|> Plug.Parsers.call(parser_opts)

# Handle cases where the body isn't read with Plug.Parsers
Expand Down
3 changes: 2 additions & 1 deletion test/req/steps_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1875,10 +1875,11 @@ defmodule Req.StepsTest do
plug = fn conn ->
{:ok, body, conn} = Plug.Conn.read_body(conn)
assert body == ~s|{"a":1}|
assert conn.query_params == %{"foo" => <<0xFF>>}
Plug.Conn.send_resp(conn, 200, "ok")
end

assert Req.request!(plug: plug, json: %{a: 1}).body == "ok"
assert Req.request!(plug: plug, json: %{a: 1}, params: %{foo: <<0xFF>>}).body == "ok"
refute_receive _
end

Expand Down