mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-04 23:55:52 +00:00
[FIXED HUDSON-1841] proxy setting shouldn't be global to JVM.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10078 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
1a5d0d13ef
commit
0543909074
5 files changed
+88
-14
No files matched your search
@@ -186,19 +186,18 @@ public final class PluginManager extends AbstractModelObject {
|
||||
}
|
||||
|
||||
public void doProxyConfigure(@QueryParameter("proxy.server") String server, @QueryParameter("proxy.port") String port, StaplerResponse rsp) throws IOException {
|
||||
setProp("http.proxyHost", Util.fixEmptyAndTrim(server));
|
||||
setProp("http.proxyPort",Util.fixEmptyAndTrim(port));
|
||||
setProp("https.proxyHost", Util.fixEmptyAndTrim(server));
|
||||
setProp("https.proxyPort",Util.fixEmptyAndTrim(port));
|
||||
Hudson hudson = Hudson.getInstance();
|
||||
server = Util.fixEmptyAndTrim(server);
|
||||
if(server==null) {
|
||||
hudson.proxy = null;
|
||||
ProxyConfiguration.getXmlFile().delete();
|
||||
} else {
|
||||
hudson.proxy = new ProxyConfiguration(server,Integer.parseInt(Util.fixEmptyAndTrim(port)));
|
||||
hudson.proxy.save();
|
||||
}
|
||||
rsp.sendRedirect("./advanced");
|
||||
}
|
||||
|
||||
private void setProp(String key, String value) {
|
||||
// System.setProperty causes NPE if t he value is null.
|
||||
if(value==null) System.getProperties().remove(key);
|
||||
else System.setProperty(key,value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Uploads a plugin.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user