Skip to content

Commit

Permalink
Merge pull request #623 from http4s/hardening-0.5
Browse files Browse the repository at this point in the history
Hardening of unregistering the http4s handler
  • Loading branch information
hamnis committed Feb 26, 2024
2 parents 0a13035 + 6bd125e commit 54c82f5
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,15 @@ private[client] class Http4sChannelPoolMap[F[_]](
}
} { h =>
val pipeline = channel.pipeline()
F.delay(if (pipeline.toMap.containsKey("http4s")) void(pipeline.remove(h)) else ())
F.delay {
if (pipeline.toMap.containsKey("http4s"))
try
void(pipeline.remove(h))
catch {
case _: Throwable => ()
}
else ()
}
}
response <- handler.dispatch(request, channel, key)
} yield response
Expand Down

0 comments on commit 54c82f5

Please sign in to comment.