8000 fixing should use proxy flag · monical1/google-http-java-client@9578ae8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9578ae8

Browse files
Daniel Ribeiromattwhisenhunt
authored andcommitted
fixing should use proxy flag
1 parent a7aa045 commit 9578ae8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

google-http-client/src/main/java/com/google/api/client/http/javanet/NetHttpTransport.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ Proxy.Type.HTTP, new InetSocketAddress(
8181
Arrays.sort(SUPPORTED_METHODS);
8282
}
8383

84+
private static final String SHOULD_USE_PROXY_FLAG = "com.google.api.client.should_use_proxy";
85+
8486
/** Factory to produce connections from {@link URL}s */
8587
private final ConnectionFactory connectionFactory;
8688

@@ -130,7 +132,7 @@ public NetHttpTransport() {
130132

131133
private ConnectionFactory getConnectionFactory(ConnectionFactory connectionFactory) {
132134
if (connectionFactory == null) {
133-
if (System.getProperty("com.api.client.should_use_proxy") != null) {
135+
if (System.getProperty(SHOULD_USE_PROXY_FLAG) != null) {
134136
return new DefaultConnectionFactory(defaultProxy());
135137
}
136138
return new DefaultConnectionFactory();
@@ -329,7 +331,7 @@ public Builder setHostnameVerifier(HostnameVerifier hostnameVerifier) {
329331

330332
/** Returns a new instance of {@link NetHttpTransport} based on the options. */
331333
public NetHttpTransport build() {
332-
if (System.getProperty("com.google.api.client.should_use_proxy") != null) {
334+
if (System.getProperty(SHOULD_USE_PROXY_FLAG) != null) {
333335
setProxy(defaultProxy());
334336
}
335337
return this.proxy == null

0 commit comments

Comments
 (0)
0