@@ -144,7 +144,6 @@ public class ApiClient extends BaseClient{
144144
145145 private String httpProxy ;
146146 private String httpsProxy ;
147- private String noProxy ;
148147
149148 /*
150149 * Constructor for ApiClient
@@ -652,61 +651,23 @@ public ApiClient setHttpsProxy(String httpsProxy) {
652651 return this ;
653652 }
654653
655- /**
656- * Get the no proxy.
657- *
658- * @return no proxy
659- */
660- public String getNoProxy () {
661- return this .noProxy ;
662- }
663-
664- /**
665- * Set the no proxy.
666- *
667- * @return Api client
668- */
669- public ApiClient setNoProxy (String noProxy ) {
670- this .noProxy = noProxy ;
671- updateClientProxy ();
672- return this ;
673- }
674-
675654 private void updateClientProxy () {
676655 httpClient .setProxySelector (new ProxySelector () {
677656 @ Override
678657 public List <Proxy > select (URI uri ) {
679- String targetHost = uri .getHost ();
680-
681- String envNoProxy = System .getenv ("NO_PROXY" );
682- if (StringUtils .isEmpty (envNoProxy )) {
683- envNoProxy = System .getenv ("no_proxy" );
684- }
685-
686- boolean noProxyFlag = false ;
687- String noProxyList = (StringUtils .isEmpty (noProxy ) ? envNoProxy : noProxy );
688- if (!StringUtils .isEmpty (noProxyList )) {
689- String [] noProxyArr = noProxyList .split ("," );
690- for (String noProxyHost : noProxyArr ) {
691- if (noProxyHost .equals (targetHost )) {
692- noProxyFlag = true ;
693- break ;
694- }
695- }
696- }
697658
698659 List <Proxy > proxies = new ArrayList <>();
699- if (noProxyFlag ) {
700- proxies .add (Proxy .NO_PROXY );
701- return proxies ;
702- }
703660
704661 if (disableSSL ) {
705662 addProxy (proxies , httpProxy , "HTTP_PROXY" );
706663 } else {
707664 addProxy (proxies , httpsProxy , "HTTPS_PROXY" );
708665 }
709666
667+ if (proxies .isEmpty ()){
668+ proxies .add (Proxy .NO_PROXY );
669+ }
670+
710671 return proxies ;
711672 }
712673
0 commit comments