abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r530114 - /incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsClient.java
Date Wed, 18 Apr 2007 18:21:21 GMT
Author: jmsnell
Date: Wed Apr 18 11:21:20 2007
New Revision: 530114

URL: http://svn.apache.org/viewvc?view=rev&rev=530114
Log:
Minor fixes for the auth handling 

Modified:
    incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsClient.java

Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsClient.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsClient.java?view=diff&rev=530114&r1=530113&r2=530114
==============================================================================
--- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsClient.java
(original)
+++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsClient.java
Wed Apr 18 11:21:20 2007
@@ -208,12 +208,19 @@
     String scheme,
     Credentials credentials) 
       throws URISyntaxException {
-    URI uri = new URI(target);
+    String host = AuthScope.ANY_HOST;
+    int port = AuthScope.ANY_PORT;
+    if (target != null) {
+      URI uri = new URI(target);
+      host = uri.getHost();
+      port = uri.getPort();
+    }
     AuthScope scope = 
       new AuthScope(
-        uri.getHost(), 
-        uri.getPort(), 
-        realm, scheme);
+        host, 
+        port, 
+        (realm != null) ? realm : AuthScope.ANY_REALM, 
+        (scheme != null) ? scheme : AuthScope.ANY_SCHEME);
     client.getState().setCredentials(
       scope, credentials);
   }



Mime
View raw message