From e769381dce1d0f6da5624a80ced7f84bb9481a71 Mon Sep 17 00:00:00 2001 From: Tushar Mathur Date: Wed, 2 Feb 2022 17:32:53 +0530 Subject: [PATCH] refactor: remove unused handler --- .../handlers/ClientResponseHandler.scala | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 zio-http/src/main/scala/zhttp/service/client/content/handlers/ClientResponseHandler.scala diff --git a/zio-http/src/main/scala/zhttp/service/client/content/handlers/ClientResponseHandler.scala b/zio-http/src/main/scala/zhttp/service/client/content/handlers/ClientResponseHandler.scala deleted file mode 100644 index a77c3daf2c..0000000000 --- a/zio-http/src/main/scala/zhttp/service/client/content/handlers/ClientResponseHandler.scala +++ /dev/null @@ -1,22 +0,0 @@ -package zhttp.service.client.content.handlers - -import io.netty.buffer.Unpooled -import io.netty.channel.{ChannelHandlerContext, SimpleChannelInboundHandler} -import io.netty.handler.codec.http.FullHttpResponse -import zhttp.http.{Headers, Status} -import zhttp.service.Client - -/** - * Transforms a Netty FullHttpResponse into a zio-http specific ClientResponse. - */ -final class ClientResponseHandler() extends SimpleChannelInboundHandler[FullHttpResponse](true) { - - override def channelRead0(ctx: ChannelHandlerContext, msg: FullHttpResponse): Unit = { - val status = Status.fromHttpResponseStatus(msg.status()) - val headers = Headers.decode(msg.headers()) - val content = Unpooled.copiedBuffer(msg.content()) - val response = Client.ClientResponse(status, headers, content) - ctx.fireChannelRead(response) - () - } -}