fix 优化 HTTP GET 请求打开重定向

This commit is contained in:
bwcx_jzy 2022-07-20 22:43:26 +08:00
parent f7030a1db9
commit 752d3f1894
No known key found for this signature in database
GPG Key ID: 5E48E9372088B9E5
5 changed files with 15 additions and 5 deletions

View File

@ -1,5 +1,15 @@
# 🚀 版本日志
## 2.9.5
### 🐣 新增功能
### 🐞 解决BUG、优化功能
1. 优化 HTTP GET 请求打开重定向
------
## 2.9.4 (2022-07-12)
### 🐣 新增功能

View File

@ -165,7 +165,7 @@ public class AutoRegSeverNode {
urlBuilder.addQuery("port", port + "");
//
String build = urlBuilder.build();
try (HttpResponse execute = HttpUtil.createGet(build).execute()) {
try (HttpResponse execute = HttpUtil.createGet(build, true).execute()) {
String body = execute.body();
Console.log("push result:" + body);
}

View File

@ -155,7 +155,7 @@ public class RemoteVersion extends BaseJsonModel {
String body = StrUtil.EMPTY;
try {
log.debug("use remote version url: {}", remoteVersionUrl);
HttpRequest request = HttpUtil.createGet(remoteVersionUrl);
HttpRequest request = HttpUtil.createGet(remoteVersionUrl, true);
try (HttpResponse execute = request.execute()) {
body = execute.body();
}
@ -203,7 +203,7 @@ public class RemoteVersion extends BaseJsonModel {
// 获取 changelog
String changelogUrl = remoteVersion.getChangelogUrl();
if (StrUtil.isNotEmpty(changelogUrl)) {
try (HttpResponse execute = HttpUtil.createGet(changelogUrl).execute()) {
try (HttpResponse execute = HttpUtil.createGet(changelogUrl, true).execute()) {
String body = execute.body();
remoteVersion.setChangelog(body);
}

View File

@ -351,7 +351,7 @@ public class NodeForward {
@SuppressWarnings({"unchecked", "rawtypes"})
public static void requestDownload(NodeModel nodeModel, HttpServletRequest request, HttpServletResponse response, NodeUrl nodeUrl) {
String url = nodeModel.getRealUrl(nodeUrl);
HttpRequest httpRequest = HttpUtil.createGet(url);
HttpRequest httpRequest = HttpUtil.createGet(url, true);
addUser(httpRequest, nodeModel, nodeUrl);
//
Map params = ServletUtil.getParams(request);

View File

@ -50,7 +50,7 @@ public class DefaultWebhookPluginImpl implements IDefaultPlugin {
return null;
}
try {
HttpRequest httpRequest = HttpUtil.createGet(webhook);
HttpRequest httpRequest = HttpUtil.createGet(webhook, true);
httpRequest.form(parameter);
try (HttpResponse execute = httpRequest.execute()) {
String body = execute.body();