diff --git a/lib/plug/parsers.ex b/lib/plug/parsers.ex index a5efb3cf..baf48441 100644 --- a/lib/plug/parsers.ex +++ b/lib/plug/parsers.ex @@ -192,9 +192,10 @@ defmodule Plug.Parsers do defmodule CacheBodyReader do def read_body(conn, opts) do - {:ok, body, conn} = Plug.Conn.read_body(conn, opts) - conn = update_in(conn.assigns[:raw_body], &[body | (&1 || [])]) - {:ok, body, conn} + with {:ok, body, conn} <- Plug.Conn.read_body(conn, opts) do + conn = update_in(conn.assigns[:raw_body], &[body | &1 || []]) + {:ok, body, conn} + end end end