瀏覽代碼

Add support for specifying the `Proxy-Authorization` header for the PluginManager

tags/v1.7.0
James Moger 9 年之前
父節點
當前提交
fbc7a7dd5f
共有 2 個文件被更改,包括 8 次插入2 次删除
  1. 5
    0
      src/main/distrib/data/defaults.properties
  2. 3
    2
      src/main/java/com/gitblit/manager/PluginManager.java

+ 5
- 0
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

+ 3
- 2
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;
}

/**

Loading…
取消
儲存