Skip to content

Commit

Permalink
feat(Headers):added new api to update headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrutiVerma97 committed Jan 13, 2022
1 parent 3a34823 commit 3a391f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions zio-http/src/main/scala/zhttp/http/Headers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ final case class Headers(toChunk: Chunk[Header]) extends HeaderExtension[Headers

def toList: List[(String, String)] = toChunk.map { case (name, value) => (name.toString, value.toString) }.toList

def modifyHeaders(f: Header => Header): Headers = Headers(toChunk.map(f(_)))

override def updateHeaders(update: Headers => Headers): Headers = update(self)

def when(cond: Boolean): Headers = if (cond) self else Headers.empty
Expand Down

1 comment on commit 3a391f2

@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: 838854.71

Please sign in to comment.