Skip to content

Commit

Permalink
feature: Response.html now supports taking in Status also
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath committed Feb 20, 2022
1 parent b57aa88 commit 2e8afb4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion zio-http/src/main/scala/zhttp/http/Response.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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("<!DOCTYPE html>" + data.encode),
headers = Headers(HeaderNames.contentType, HeaderValues.textHtml),
)
Expand Down

2 comments on commit 2e8afb4

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Performance Benchmark:

Concurrency: 256
Requests/sec: 929196.02

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Performance Benchmark:

Concurrency: 256
Requests/sec: 961458.82

Please sign in to comment.