From: James Moger Date: Wed, 3 Dec 2014 20:05:49 +0000 (-0500) Subject: Add support for specifying the `Proxy-Authorization` header for the PluginManager X-Git-Tag: v1.7.0~1^2~93^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fbc7a7dd5fa61486610cf11c09e0007f2900a3e1;p=gitblit.git Add support for specifying the `Proxy-Authorization` header for the PluginManager --- 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; } /**