@@ -179,9 +179,15 @@ public Airtable configure(Configuration config, ObjectMapper objectMapper) throw
179179 * @param proxy
180180 */
181181 public void setProxy (String proxy ) {
182- if (proxy != null && !proxy .isEmpty () && !proxy .equals (" " )) {
182+
183+ if (proxy == null ) {
184+ this .config .setProxy (proxy );
185+ Unirest .setProxy (null );
186+ } else {
183187 this .config .setProxy (proxy );
188+ Unirest .setProxy (HttpHost .create (this .config .getProxy ()));
184189 }
190+
185191 }
186192
187193 /**
@@ -200,18 +206,22 @@ private void configureProxy(String endpointUrl) {
200206 && (endpointUrl .contains ("127.0.0.1" )
201207 || endpointUrl .contains ("localhost" ))) {
202208 LOG .info ("Use Proxy: ignored for 'localhost' ann '127.0.0.1'" );
203- this . config . setProxy (null );
209+ setProxy (null );
204210 } else if (httpsProxy != null
205211 && (endpointUrl .contains ("https" ))) {
206212 LOG .info ("Use Proxy: Environment variable 'https_proxy' found and used: " + httpsProxy );
207- this . config . setProxy (httpProxy );
213+ setProxy (httpProxy );
208214 } else if (httpProxy != null
209215 && (endpointUrl .contains ("http" ))) {
210216 LOG .info ("Use Proxy: Environment variable 'http_proxy' found and used: " + httpProxy );
211- this . config . setProxy (httpsProxy );
217+ setProxy (httpsProxy );
212218 } else {
213- this . config . setProxy (null );
219+ setProxy (null );
214220 }
221+ } else if ((endpointUrl .contains ("127.0.0.1" )
222+ || endpointUrl .contains ("localhost" ))) {
223+ LOG .info ("Use Proxy: ignored for 'localhost' ann '127.0.0.1'" );
224+ setProxy (null );
215225 }
216226 }
217227
0 commit comments