Skip to content

Commit 3a825db

Browse files
committed
Set 'useSystemProperties' on HttpClient builder
Set the httpClientBuilder.useSystemProperties() so that users may set the proxy settings via system properties eg ``` -Djava.net.useSystemProxies=true -Dhttp.proxyHost=PROXY_HOST -Dhttp.proxyPort=PROXY_PORT -Dhttp.proxyUser=USERNAME -Dhttp.proxyPassword=PASSWORD ```
1 parent 2f906ba commit 3a825db

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
services:
1010
postgis11:
11-
image: postgis/postgis:11-2.5
11+
image: postgis/postgis:13-3.3
1212
ports:
1313
- 5432:5432
1414
env:

src/main/java/org/maproulette/client/http/HttpResource.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ private InputStream response() throws MapRouletteException
141141
final var target = new HttpHost(this.uri.getHost(), this.uri.getPort(),
142142
this.uri.getScheme());
143143
final var context = HttpClientContext.create();
144-
final var clientBuilder = HttpClients.custom();
144+
// Create a builder that supports reading from system properties so things like
145+
// proxies can be used with -Dhttp.proxyHost, -Dhttp.proxyPort.
146+
final var clientBuilder = HttpClients.custom().useSystemProperties();
145147
if (this.creds != null)
146148
{
147149
final var credsProvider = new BasicCredentialsProvider();

0 commit comments

Comments
 (0)