Skip to content

Commit

Permalink
refactor: remove host header changes and RequestSpec (#945)
Browse files Browse the repository at this point in the history
  • Loading branch information
girdharshubham authored Feb 2, 2022
1 parent e769381 commit 1e8d81b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 55 deletions.
14 changes: 4 additions & 10 deletions zio-http/src/main/scala/zhttp/http/Request.scala
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,10 @@ object Request {
remoteAddress: Option[InetAddress] = None,
data: HttpData = HttpData.Empty,
): Request = {
val hostHeaders = (url.host, url.port) match {
case (Some(name), None) => Headers.host(name)
case (Some(name), Some(80 | 443)) => Headers.host(name)
case (Some(name), Some(port)) => Headers.host(s"${name}:${port}")
case _ => Headers.empty
}
val m = method
val u = url
val h = headers ++ hostHeaders
val ra = remoteAddress
val m = method
val u = url
val h = headers
val ra = remoteAddress
new Request {
override def method: Method = m
override def url: URL = u
Expand Down
45 changes: 0 additions & 45 deletions zio-http/src/test/scala/zhttp/http/RequestSpec.scala

This file was deleted.

1 comment on commit 1e8d81b

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

Please sign in to comment.