Skip to content

Commit e25ae6b

Browse files
doumdoumDominique Villardvelo
authored
Minor: set request factory in Google http client constructor (#1509)
Co-authored-by: Dominique Villard <dominique.villard@orange.com> Co-authored-by: Marvin Froeder <velo@users.noreply.github.com>
1 parent c2503e6 commit e25ae6b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

googlehttpclient/src/main/java/feign/googlehttpclient/GoogleHttpClient.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2020 The Feign Authors
2+
* Copyright 2012-2021 The Feign Authors
33
*
44
* <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
55
* except in compliance with the License. You may obtain a copy of the License at
@@ -40,16 +40,18 @@
4040
* "https://api.github.com");
4141
*/
4242
public class GoogleHttpClient implements Client {
43-
private final HttpTransport transport;
4443
private final HttpRequestFactory requestFactory;
4544

4645
public GoogleHttpClient() {
4746
this(new NetHttpTransport());
4847
}
4948

5049
public GoogleHttpClient(final HttpTransport transport) {
51-
this.transport = transport;
52-
this.requestFactory = transport.createRequestFactory();
50+
this(transport.createRequestFactory());
51+
}
52+
53+
public GoogleHttpClient(final HttpRequestFactory requestFactory) {
54+
this.requestFactory = requestFactory;
5355
}
5456

5557
@Override

0 commit comments

Comments
 (0)