SDK的地址和密钥添加trim,避免空格换行等问题

This commit is contained in:
heavyrian2012
2025-01-02 14:23:23 +08:00
parent dafb0cd4d9
commit 83e9679339
3 changed files with 8 additions and 8 deletions
@@ -38,8 +38,8 @@ public class AdminHttpUtils extends JsonUtils {
private static CloseableHttpClient httpClient; private static CloseableHttpClient httpClient;
public static void init(String url, String secret) { public static void init(String url, String secret) {
adminUrl = url; adminUrl = url.trim();
adminSecret = secret; adminSecret = secret.trim();
PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(); PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager();
cm.setValidateAfterInactivity(1000); cm.setValidateAfterInactivity(1000);
httpClient = HttpClients.custom() httpClient = HttpClients.custom()
@@ -35,9 +35,9 @@ public class ChannelHttpUtils extends JsonUtils {
private final CloseableHttpClient httpClient; private final CloseableHttpClient httpClient;
public ChannelHttpUtils(String imurl, String channelId, String secret) { public ChannelHttpUtils(String imurl, String channelId, String secret) {
this.imurl = imurl; this.imurl = imurl.trim();
this.channelId = channelId; this.channelId = channelId.trim();
this.channelSecret = secret; this.channelSecret = secret.trim();
PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(); PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager();
cm.setValidateAfterInactivity(1000); cm.setValidateAfterInactivity(1000);
httpClient = HttpClients.custom() httpClient = HttpClients.custom()
@@ -36,9 +36,9 @@ public class RobotHttpUtils extends JsonUtils {
private final CloseableHttpClient httpClient; private final CloseableHttpClient httpClient;
public RobotHttpUtils(String url, String robotId, String robotSecret) { public RobotHttpUtils(String url, String robotId, String robotSecret) {
this.url = url; this.url = url.trim();
this.robotId = robotId; this.robotId = robotId.trim();
this.robotSecret = robotSecret; this.robotSecret = robotSecret.trim();
PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(); PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager();
cm.setValidateAfterInactivity(1000); cm.setValidateAfterInactivity(1000);
httpClient = HttpClients.custom() httpClient = HttpClients.custom()