From e69d3aca4ec6faabdc5aa189f77383aa5d4bf9cb Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 11 Jan 2025 11:53:53 -0500 Subject: [PATCH] Avoid unnecessarily collapsing iodata in request bodies --- lib/philomena_query/search/client.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/philomena_query/search/client.ex b/lib/philomena_query/search/client.ex index 98a81820..42e69e40 100644 --- a/lib/philomena_query/search/client.ex +++ b/lib/philomena_query/search/client.ex @@ -46,10 +46,10 @@ defmodule PhilomenaQuery.Search.Client do end defp encode_body(body) when is_map(body), - do: Jason.encode!(body) + do: Jason.encode_to_iodata!(body) defp encode_body(body) when is_list(body), - do: [Enum.map_intersperse(body, "\n", &Jason.encode!(&1)), "\n"] + do: [Enum.map_intersperse(body, "\n", &Jason.encode_to_iodata!(&1)), "\n"] defp encode_options, do: [headers: request_headers(), receive_timeout: @receive_timeout]