@@ -176,26 +176,20 @@ private static final class HttpClientBuildContext<U, R> {
176
176
177
177
@ Nullable
178
178
private final BiIntFunction <Throwable , ? extends Completable > serviceDiscovererRetryStrategy ;
179
- @ Nullable
180
- private final U proxyAddress ;
181
179
182
180
HttpClientBuildContext (
183
181
final DefaultSingleAddressHttpClientBuilder <U , R > builder ,
184
182
final ServiceDiscoverer <U , R , ? extends ServiceDiscovererEvent <R >> sd ,
185
- @ Nullable final BiIntFunction <Throwable , ? extends Completable > serviceDiscovererRetryStrategy ,
186
- @ Nullable final U proxyAddress ) {
183
+ @ Nullable final BiIntFunction <Throwable , ? extends Completable > serviceDiscovererRetryStrategy ) {
187
184
this .builder = builder ;
188
185
this .serviceDiscovererRetryStrategy = serviceDiscovererRetryStrategy ;
189
- this .proxyAddress = proxyAddress ;
190
186
this .sd = sd ;
191
187
this .sdStatus = new SdStatusCompletable ();
192
188
}
193
189
194
190
U address () {
195
191
assert builder .address != null : "Attempted to buildStreaming with an unknown address" ;
196
- return proxyAddress != null ? proxyAddress :
197
- // the builder can be modified post-context creation, therefore proxy can be set
198
- (builder .proxyAddress != null ? builder .proxyAddress : builder .address );
192
+ return builder .proxyAddress != null ? builder .proxyAddress : builder .address ;
199
193
}
200
194
201
195
HttpClientConfig httpConfig () {
@@ -383,8 +377,9 @@ private static StreamingHttpRequestResponseFactory defaultReqRespFactory(ReadOnl
383
377
}
384
378
385
379
private static <U , R > String targetAddress (final HttpClientBuildContext <U , R > ctx ) {
386
- return ctx .proxyAddress == null ?
387
- ctx .builder .address .toString () : ctx .builder .address + " (via " + ctx .proxyAddress + ")" ;
380
+ assert ctx .builder .address != null ;
381
+ return ctx .builder .proxyAddress == null ?
382
+ ctx .builder .address .toString () : ctx .builder .address + " (via " + ctx .builder .proxyAddress + ")" ;
388
383
}
389
384
390
385
private static ContextAwareStreamingHttpClientFilterFactory appendFilter (
@@ -433,7 +428,7 @@ private static ContextAwareStreamingHttpClientFilterFactory appendFilter(
433
428
*/
434
429
private HttpClientBuildContext <U , R > copyBuildCtx () {
435
430
return new HttpClientBuildContext <>(new DefaultSingleAddressHttpClientBuilder <>(address , this ),
436
- this .serviceDiscoverer , this .serviceDiscovererRetryStrategy , this . proxyAddress );
431
+ this .serviceDiscoverer , this .serviceDiscovererRetryStrategy );
437
432
}
438
433
439
434
private AbsoluteAddressHttpRequesterFilter proxyAbsoluteAddressFilterFactory () {
0 commit comments