Skip to content

Commit acc024c

Browse files
authored
Merge pull request #779 from slandelle/series/0.5
fix: ProxyHandler is not set at the right place in the pipeline
2 parents ff44d07 + 14f8aa5 commit acc024c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

client/src/main/scala/org/http4s/netty/client/Http4sChannelPoolMap.scala

+9-9
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,15 @@ private[client] class Http4sChannelPoolMap[F[_]](
192192
None
193193
)
194194
val pipeline = channel.pipeline()
195+
config.proxy.foreach {
196+
case p: HttpProxy =>
197+
p.toProxyHandler(key.requestKey).foreach { handler =>
198+
void(pipeline.addLast("proxy", handler))
199+
}
200+
case s: Socks =>
201+
void(pipeline.addLast("proxy", s.toProxyHandler))
202+
}
203+
195204
(key.requestKey, SSLContextOption.toMaybeSSLContext(config.sslConfig)) match {
196205
case (RequestKey(Scheme.https, Uri.Authority(_, host, mayBePort)), Some(context)) =>
197206
void {
@@ -210,15 +219,6 @@ private[client] class Http4sChannelPoolMap[F[_]](
210219
case _ => ()
211220
}
212221

213-
config.proxy.foreach {
214-
case p: HttpProxy =>
215-
p.toProxyHandler(key.requestKey).foreach { handler =>
216-
void(pipeline.addLast("proxy", handler))
217-
}
218-
case s: Socks =>
219-
void(pipeline.addLast("proxy", s.toProxyHandler))
220-
}
221-
222222
configurePipeline(channel, key)
223223
}
224224
}

0 commit comments

Comments
 (0)