Skip to content

Commit

Permalink
Limit Scheme.Custom construction to calling decode
Browse files Browse the repository at this point in the history
  • Loading branch information
987Nabil committed Nov 24, 2023
1 parent 33512bc commit 7267a4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zio-http/src/main/scala/zio/http/Scheme.scala
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ object Scheme {
case "https" => HTTPS
case "ws" => WS
case "wss" => WSS
case custom => Custom(custom.toLowerCase)
case custom => new Custom(custom.toLowerCase) {}
}
}
}
Expand All @@ -94,7 +94,7 @@ object Scheme {
* @param scheme
* value MUST not be "http" "https" "ws" "wss"
*/
final case class Custom(scheme: String) extends Scheme
sealed abstract case class Custom private[http] (scheme: String) extends Scheme

def defaultPortForHTTP = 80
def defaultPortForHTTPS = 443
Expand Down

0 comments on commit 7267a4d

Please sign in to comment.