-
Patch
-
Resolution: Unresolved
-
Major
-
None
-
all
In URLSRC.java revision 23018 near line 68 and also line 123
// example url string.
String urlString = "http://user:pass@source/hudson/job/MyJob/lastSuccessfulBuild/artifact/trunk/artifact.jar";
URL url = new URL(urlString);
URLConnection connection = url.openConnection();
String userinfo = url.getUserInfo();
if(userinfo!=null) {
String[] userpass = userinfo.split(":");
if(userpass.length>0) {
String username = userpass[0];
String password = "";
if(userpass.length>1)
String auth = "Basic " + (new sun.misc.BASE64Encoder().encode((username + ":" + password).getBytes()));
connection.setRequestProperty("Authorization", auth);
}
}
InputStream is = connection.getInputStream();