Skip to content

Commit

Permalink
Actually Match on header string
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherDavenport committed Nov 20, 2021
1 parent 1397cc6 commit 954d69f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/scala/io/chrisdavenport/curly/CurlyData.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ object CurlyData {
}.getOrElse(new Throwable("No Uri Component Found").raiseError)
val headers = opts.collect{
// Hackity Hack
case Opt(header, value) if (value.split(":").toList.size == 2) => value.split(":").toList match {
case Opt("header", value) if (value.split(":").toList.size == 2) => value.split(":").toList match {
case header :: value :: Nil =>
(header.trim(), value.trim()).pure[F]
case _ => new Throwable(s"Incorrect Header $header $value").raiseError[F, (String, String)]
case _ => new Throwable(s"Incorrect Header $value").raiseError[F, (String, String)]
}
}.sequence

Expand Down

0 comments on commit 954d69f

Please sign in to comment.