From 1988b188404a8c3b4de995a07ac914af02049b18 Mon Sep 17 00:00:00 2001 From: Nabil Abdel-Hafeez <7283535+987Nabil@users.noreply.github.com> Date: Sat, 14 Sep 2024 04:36:46 +0200 Subject: [PATCH] Save one copy call (#3137) --- .../src/main/scala/zio/http/codec/internal/BodyCodec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zio-http/shared/src/main/scala/zio/http/codec/internal/BodyCodec.scala b/zio-http/shared/src/main/scala/zio/http/codec/internal/BodyCodec.scala index c51a28a594..feb9f64ee1 100644 --- a/zio-http/shared/src/main/scala/zio/http/codec/internal/BodyCodec.scala +++ b/zio-http/shared/src/main/scala/zio/http/codec/internal/BodyCodec.scala @@ -159,7 +159,7 @@ private[http] object BodyCodec { trace: Trace, ): Body = { val (mediaType, bc @ BinaryCodecWithSchema(_, _)) = codec.chooseFirstOrDefault(mediaTypes) - Body.fromChunk(bc.codec(config).encode(value)).contentType(mediaType) + Body.fromChunk(bc.codec(config).encode(value), mediaType) } type Element = A