From 2e8afb4acb2e7b8e2309d645ff09266b8880d9d4 Mon Sep 17 00:00:00 2001 From: Tushar Mathur Date: Sat, 19 Feb 2022 23:25:31 +0530 Subject: [PATCH] feature: Response.html now supports taking in Status also --- zio-http/src/main/scala/zhttp/http/Response.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zio-http/src/main/scala/zhttp/http/Response.scala b/zio-http/src/main/scala/zhttp/http/Response.scala index dc9f3c5070..a2acf2f01b 100644 --- a/zio-http/src/main/scala/zhttp/http/Response.scala +++ b/zio-http/src/main/scala/zhttp/http/Response.scala @@ -172,8 +172,9 @@ object Response { /** * Creates a response with content-type set to text/html */ - def html(data: Html): Response = + def html(data: Html, status: Status = Status.OK): Response = Response( + status = status, data = HttpData.fromString("" + data.encode), headers = Headers(HeaderNames.contentType, HeaderValues.textHtml), )