mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
change link
This commit is contained in:
@@ -124,7 +124,7 @@ public class HttpConnection {
|
||||
HttpGlobalConfig.allowPatch();
|
||||
} catch (Exception ignore){
|
||||
// ignore
|
||||
// https://github.com/dromara/hutool/issues/2832
|
||||
// https://github.com/chinabugotech/hutool/issues/2832
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -277,7 +277,7 @@ public class HttpConnection {
|
||||
final HttpsURLConnection httpsConn = (HttpsURLConnection) conn;
|
||||
// 验证域
|
||||
httpsConn.setHostnameVerifier(ObjectUtil.defaultIfNull(hostnameVerifier,
|
||||
// CVE-2022-22885 https://github.com/dromara/hutool/issues/2042
|
||||
// CVE-2022-22885 https://github.com/chinabugotech/hutool/issues/2042
|
||||
// 增加全局变量可选是否不验证host
|
||||
HttpGlobalConfig.isTrustAnyHost() ? DefaultSSLInfo.TRUST_ANY_HOSTNAME_VERIFIER : HttpsURLConnection.getDefaultHostnameVerifier()));
|
||||
httpsConn.setSSLSocketFactory(ObjectUtil.defaultIfNull(ssf, DefaultSSLInfo.DEFAULT_SSF));
|
||||
|
@@ -69,7 +69,7 @@ public class HttpDownloader {
|
||||
|
||||
/**
|
||||
* 下载文件-避免未完成的文件<br>
|
||||
* 来自:https://gitee.com/dromara/hutool/pulls/407<br>
|
||||
* 来自:https://gitee.com/chinabugotech/hutool/pulls/407<br>
|
||||
* 此方法原理是先在目标文件同级目录下创建临时文件,下载之,等下载完毕后重命名,避免因下载错误导致的文件不完整。
|
||||
*
|
||||
* @param url 请求的url
|
||||
|
@@ -224,7 +224,7 @@ public class HttpGlobalConfig implements Serializable {
|
||||
|
||||
/**
|
||||
* 是否信任所有Host<br>
|
||||
* 见:https://github.com/dromara/hutool/issues/2042<br>
|
||||
* 见:https://github.com/chinabugotech/hutool/issues/2042<br>
|
||||
*
|
||||
* @param customTrustAnyHost 如果设置为{@code false},则按照JDK默认验证机制,验证目标服务器的证书host和请求host是否一致,{@code true}表示不验证。
|
||||
* @since 5.8.27
|
||||
|
@@ -310,7 +310,7 @@ public class HttpRequest extends HttpBase<HttpRequest> {
|
||||
* 它会验证 SSL 服务器在数字证书中返回的主机名是否与用于连接 SSL 服务器的 URL 主机名相匹配。如果主机名不匹配,则删除此连接。<br>
|
||||
* 因此weblogic不支持https的sni协议的主机名验证,此时需要将此值设置为sun.net.www.protocol.https.Handler对象。
|
||||
* <p>
|
||||
* 相关issue见:<a href="https://gitee.com/dromara/hutool/issues/IMD1X">https://gitee.com/dromara/hutool/issues/IMD1X</a>
|
||||
* 相关issue见:<a href="https://gitee.com/chinabugotech/hutool/issues/IMD1X">https://gitee.com/chinabugotech/hutool/issues/IMD1X</a>
|
||||
*
|
||||
* @param urlHandler {@link URLStreamHandler}
|
||||
* @return this
|
||||
@@ -1303,7 +1303,7 @@ public class HttpRequest extends HttpBase<HttpRequest> {
|
||||
throw new HttpException(e);
|
||||
}
|
||||
// 支持自动重定向时处理cookie
|
||||
// https://github.com/dromara/hutool/issues/2960
|
||||
// https://github.com/chinabugotech/hutool/issues/2960
|
||||
if (config.followRedirectsCookie) {
|
||||
GlobalCookieManager.store(httpConnection);
|
||||
}
|
||||
|
@@ -327,7 +327,7 @@ public class HttpResponse extends HttpBase<HttpResponse> implements Closeable {
|
||||
* 将响应内容写出到文件-避免未完成的文件<br>
|
||||
* 异步模式下直接读取Http流写出,同步模式下将存储在内存中的响应内容写出<br>
|
||||
* 写出后会关闭Http流(异步模式)<br>
|
||||
* 来自:https://gitee.com/dromara/hutool/pulls/407<br>
|
||||
* 来自:https://gitee.com/chinabugotech/hutool/pulls/407<br>
|
||||
* 此方法原理是先在目标文件同级目录下创建临时文件,下载之,等下载完毕后重命名,避免因下载错误导致的文件不完整。
|
||||
*
|
||||
* @param targetFileOrDir 写出到的文件或目录
|
||||
|
@@ -72,7 +72,7 @@ public class UploadTest {
|
||||
@Test
|
||||
@Disabled
|
||||
public void smmsTest(){
|
||||
// https://github.com/dromara/hutool/issues/2079
|
||||
// https://github.com/chinabugotech/hutool/issues/2079
|
||||
// hutool的user agent 被封了
|
||||
String token = "test";
|
||||
String url = "https://sm.ms/api/v2/upload";
|
||||
|
@@ -1,8 +1,9 @@
|
||||
package cn.hutool.http.useragent;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class UserAgentUtilTest {
|
||||
|
||||
@Test
|
||||
@@ -204,7 +205,7 @@ public class UserAgentUtilTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://github.com/dromara/hutool/issues/1177
|
||||
* https://github.com/chinabugotech/hutool/issues/1177
|
||||
*/
|
||||
@Test
|
||||
public void parseMicroMessengerTest() {
|
||||
@@ -361,7 +362,7 @@ public class UserAgentUtilTest {
|
||||
|
||||
@Test
|
||||
public void parseEdgATest(){
|
||||
// https://gitee.com/dromara/hutool/issues/I4MCBP
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I4MCBP
|
||||
final String uaStr = "userAgent: Mozilla/5.0 (Linux; Android 11; MI 9 Transparent Edition) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Mobile Safari/537.36 EdgA/96.0.1054.36";
|
||||
final UserAgent ua = UserAgentUtil.parse(uaStr);
|
||||
assertEquals("MSEdge", ua.getBrowser().toString());
|
||||
@@ -376,7 +377,7 @@ public class UserAgentUtilTest {
|
||||
|
||||
@Test
|
||||
public void parseLenovoTest(){
|
||||
// https://gitee.com/dromara/hutool/issues/I4QBMD
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I4QBMD
|
||||
final String uaStr = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36 SLBrowser/7.0.0.6241 SLBChan/30";
|
||||
final UserAgent ua = UserAgentUtil.parse(uaStr);
|
||||
|
||||
@@ -407,7 +408,7 @@ public class UserAgentUtilTest {
|
||||
|
||||
@Test
|
||||
public void parseFromDeepinTest(){
|
||||
// https://gitee.com/dromara/hutool/issues/I50YGY
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I50YGY
|
||||
final String uaStr = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36";
|
||||
final UserAgent ua = UserAgentUtil.parse(uaStr);
|
||||
assertEquals("Linux", ua.getOs().toString());
|
||||
@@ -438,7 +439,7 @@ public class UserAgentUtilTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* <a href="https://gitee.com/dromara/hutool/issues/I7OTCU">fix : issues I7OTCU </a>
|
||||
* <a href="https://gitee.com/chinabugotech/hutool/issues/I7OTCU">fix : issues I7OTCU </a>
|
||||
*/
|
||||
@Test
|
||||
public void issuseI7OTCUTest() {
|
||||
|
Reference in New Issue
Block a user