File tree 1 file changed +3
-4
lines changed
client/src/main/java/org/asynchttpclient 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ public class DefaultAsyncHttpClient implements AsyncHttpClient {
42
42
43
43
private final static Logger LOGGER = LoggerFactory .getLogger (DefaultAsyncHttpClient .class );
44
44
private final AsyncHttpClientConfig config ;
45
+ private final boolean noRequestFilters ;
45
46
private final AtomicBoolean closed = new AtomicBoolean (false );
46
47
private final ChannelManager channelManager ;
47
48
private final NettyRequestSender requestSender ;
@@ -78,7 +79,7 @@ public DefaultAsyncHttpClient() {
78
79
public DefaultAsyncHttpClient (AsyncHttpClientConfig config ) {
79
80
80
81
this .config = config ;
81
-
82
+ this . noRequestFilters = config . getRequestFilters (). isEmpty ();
82
83
allowStopNettyTimer = config .getNettyTimer () == null ;
83
84
nettyTimer = allowStopNettyTimer ? newNettyTimer () : config .getNettyTimer ();
84
85
@@ -179,10 +180,8 @@ public BoundRequestBuilder prepareRequest(RequestBuilder requestBuilder) {
179
180
180
181
@ Override
181
182
public <T > ListenableFuture <T > executeRequest (Request request , AsyncHandler <T > handler ) {
182
-
183
- if (config .getRequestFilters ().isEmpty ()) {
183
+ if (noRequestFilters ) {
184
184
return execute (request , handler );
185
-
186
185
} else {
187
186
FilterContext <T > fc = new FilterContext .FilterContextBuilder <T >().asyncHandler (handler ).request (request ).build ();
188
187
try {
You can’t perform that action at this time.
0 commit comments