Skip to content

Commit

Permalink
Fix use of basic auth in script URL
Browse files Browse the repository at this point in the history
  • Loading branch information
gschueler committed Jun 18, 2012
1 parent a426c8b commit 1984747
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -241,14 +241,14 @@ private void updateHTTPUrl(final File destinationFile) throws FileUpdaterExcepti
url.getPort() > 0 ? url.getPort() : url.getDefaultPort(),
AuthScope.ANY_REALM, "BASIC");
cred = new UsernamePasswordCredentials(url.getUserInfo());
urlToUse = new URL(url.getHost(), url.getHost(), url.getPort(), url.getFile()).toExternalForm();
urlToUse = new URL(url.getProtocol(), url.getHost(), url.getPort(), url.getFile()).toExternalForm();
} else if (null != username && null != password) {
doauth = true;
authscope = new AuthScope(url.getHost(),
url.getPort() > 0 ? url.getPort() : url.getDefaultPort(),
AuthScope.ANY_REALM, "BASIC");
cred = new UsernamePasswordCredentials(username + ":" + password);
urlToUse = new URL(url.getHost(), url.getHost(), url.getPort(), url.getFile()).toExternalForm();
urlToUse = new URL(url.getProtocol(), url.getHost(), url.getPort(), url.getFile()).toExternalForm();
}
} catch (MalformedURLException e) {
throw new FileUpdaterException("Failed to configure base URL for authentication: " + e.getMessage(),
Expand Down

0 comments on commit 1984747

Please sign in to comment.