diff options
author | James Moger <james.moger@gitblit.com> | 2014-12-03 15:05:49 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-12-03 15:05:49 -0500 |
commit | fbc7a7dd5fa61486610cf11c09e0007f2900a3e1 (patch) | |
tree | 775c801509e078759adc0920d1e5aa0ce9ad16f0 /src | |
parent | d86f4a0860704e3bda77fa9622a8d0210265b616 (diff) | |
download | gitblit-fbc7a7dd5fa61486610cf11c09e0007f2900a3e1.tar.gz gitblit-fbc7a7dd5fa61486610cf11c09e0007f2900a3e1.zip |
Add support for specifying the `Proxy-Authorization` header for the PluginManager
Diffstat (limited to 'src')
-rw-r--r-- | src/main/distrib/data/defaults.properties | 5 | ||||
-rw-r--r-- | src/main/java/com/gitblit/manager/PluginManager.java | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/main/distrib/data/defaults.properties b/src/main/distrib/data/defaults.properties index 093dd857..6fddf0b3 100644 --- a/src/main/distrib/data/defaults.properties +++ b/src/main/distrib/data/defaults.properties @@ -582,6 +582,11 @@ plugins.httpProxyHost = # SINCE 1.7.0 plugins.httpProxyPort = +# The HTTP proxy authorization header for plugin manager. +# +# SINCE 1.7.0 +plugins.httpProxyAuthorization = + # Number of threads used to handle miscellaneous tasks in the background. # # SINCE 1.6.0 diff --git a/src/main/java/com/gitblit/manager/PluginManager.java b/src/main/java/com/gitblit/manager/PluginManager.java index a43cbdc8..bc3be52f 100644 --- a/src/main/java/com/gitblit/manager/PluginManager.java +++ b/src/main/java/com/gitblit/manager/PluginManager.java @@ -589,7 +589,7 @@ public class PluginManager implements IPluginManager, PluginStateListener { protected Proxy getProxy(URL url) { String proxyHost = runtimeManager.getSettings().getString(Keys.plugins.httpProxyHost, ""); String proxyPort = runtimeManager.getSettings().getString(Keys.plugins.httpProxyPort, ""); - + if (!StringUtils.isEmpty(proxyHost) && !StringUtils.isEmpty(proxyPort)) { return new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, Integer.parseInt(proxyPort))); } else { @@ -598,7 +598,8 @@ public class PluginManager implements IPluginManager, PluginStateListener { } protected String getProxyAuthorization(URL url) { - return ""; + String proxyAuth = runtimeManager.getSettings().getString(Keys.plugins.httpProxyAuthorization, ""); + return proxyAuth; } /** |