hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1730838 - in /httpcomponents/httpclient/trunk/httpclient5-osgi/src: main/java/org/apache/hc/client5/http/osgi/impl/ test/java/org/apache/hc/client5/http/osgi/impl/
Date Wed, 17 Feb 2016 14:00:52 GMT
Author: olegk
Date: Wed Feb 17 14:00:52 2016
New Revision: 1730838

URL: http://svn.apache.org/viewvc?rev=1730838&view=rev
Log:
HTTPCLIENT-1718, HTTPCLEINT-1719: credentials fix to allow proxy authetication
Contributed by 212427891 <munene.kiruja at ge.com>

Modified:
    httpcomponents/httpclient/trunk/httpclient5-osgi/src/main/java/org/apache/hc/client5/http/osgi/impl/OSGiCredentialsProvider.java
    httpcomponents/httpclient/trunk/httpclient5-osgi/src/main/java/org/apache/hc/client5/http/osgi/impl/OSGiProxyConfiguration.java
    httpcomponents/httpclient/trunk/httpclient5-osgi/src/test/java/org/apache/hc/client5/http/osgi/impl/OSGiProxyConfigurationTest.java

Modified: httpcomponents/httpclient/trunk/httpclient5-osgi/src/main/java/org/apache/hc/client5/http/osgi/impl/OSGiCredentialsProvider.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5-osgi/src/main/java/org/apache/hc/client5/http/osgi/impl/OSGiCredentialsProvider.java?rev=1730838&r1=1730837&r2=1730838&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5-osgi/src/main/java/org/apache/hc/client5/http/osgi/impl/OSGiCredentialsProvider.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient5-osgi/src/main/java/org/apache/hc/client5/http/osgi/impl/OSGiCredentialsProvider.java
Wed Feb 17 14:00:52 2016
@@ -72,12 +72,11 @@ final class OSGiCredentialsProvider impl
                 final ProxyConfiguration proxyConfiguration = (ProxyConfiguration) proxyConfigurationObject;
                 if (proxyConfiguration.isEnabled()) {
                     final AuthScope actual = new AuthScope(proxyConfiguration.getHostname(),
proxyConfiguration.getPort());
-                    if (authscope.equals(actual)) {
+                    if (authscope.match(actual) >= 12) {
                         final String username = proxyConfiguration.getUsername();
                         final String password = proxyConfiguration.getPassword();
                         return new UsernamePasswordCredentials(username, password != null
? password.toCharArray() : null);
                     }
-
                 }
             }
         }

Modified: httpcomponents/httpclient/trunk/httpclient5-osgi/src/main/java/org/apache/hc/client5/http/osgi/impl/OSGiProxyConfiguration.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5-osgi/src/main/java/org/apache/hc/client5/http/osgi/impl/OSGiProxyConfiguration.java?rev=1730838&r1=1730837&r2=1730838&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5-osgi/src/main/java/org/apache/hc/client5/http/osgi/impl/OSGiProxyConfiguration.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient5-osgi/src/main/java/org/apache/hc/client5/http/osgi/impl/OSGiProxyConfiguration.java
Wed Feb 17 14:00:52 2016
@@ -63,7 +63,7 @@ public final class OSGiProxyConfiguratio
     /**
      * Property representing the username to authenticate with towards the proxy. Defaults
to empty.
      */
-    private static final String PROPERTYNAME_PROXY_USERNAME = "proxy.username";
+    private static final String PROPERTYNAME_PROXY_USERNAME = "proxy.user";
 
     private static final String PROPERTYDEFAULT_PROXY_USERNAME = "";
 

Modified: httpcomponents/httpclient/trunk/httpclient5-osgi/src/test/java/org/apache/hc/client5/http/osgi/impl/OSGiProxyConfigurationTest.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5-osgi/src/test/java/org/apache/hc/client5/http/osgi/impl/OSGiProxyConfigurationTest.java?rev=1730838&r1=1730837&r2=1730838&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5-osgi/src/test/java/org/apache/hc/client5/http/osgi/impl/OSGiProxyConfigurationTest.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient5-osgi/src/test/java/org/apache/hc/client5/http/osgi/impl/OSGiProxyConfigurationTest.java
Wed Feb 17 14:00:52 2016
@@ -43,7 +43,7 @@ public class OSGiProxyConfigurationTest
         config.put("proxy.enabled", false);
         config.put("proxy.host", "h");
         config.put("proxy.port", 1);
-        config.put("proxy.username", "u");
+        config.put("proxy.user", "u");
         config.put("proxy.password", "p");
         config.put("proxy.exceptions", new String[]{"e"});
 



Mime
View raw message