Skip to content

Commit

Permalink
handle urls that don't include user:pass. oops :)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Newson committed Jul 19, 2010
1 parent 378e322 commit a02e300
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ public static synchronized HttpClient getInstance() throws MalformedURLException
final String key = (String) it.next();
if (!key.startsWith("lucene.") && key.endsWith(".url")) {
final URL url = new URL(INI.getString(key));
credsProvider.setCredentials(
new AuthScope(url.getHost(), url.getPort()),
new UsernamePasswordCredentials(url.getUserInfo()));
if (url.getUserInfo() != null) {
credsProvider.setCredentials(
new AuthScope(url.getHost(), url.getPort()),
new UsernamePasswordCredentials(url.getUserInfo()));
}
}
}
instance.setCredentialsProvider(credsProvider);
Expand Down

0 comments on commit a02e300

Please sign in to comment.