mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
修复UrlBuilder中参数中包括"://"判断错误问题
This commit is contained in:
parent
7ee9b163c4
commit
b78657f67f
@ -22,7 +22,8 @@
|
||||
* 【db 】 修复NamedSql中in没有判断大小写问题(issue#2792@Github)
|
||||
* 【core 】 修复ZIP bomb漏洞(issue#2797@Github)
|
||||
* 【core 】 修复JSONXMLSerializer将Json转为XML时,遇到嵌套需要递归情况时会丢失contentKeys问题(pr#903@Gitee)
|
||||
* 【core 】 修复通过jdbcurl创建SimpleDataSource报NullPointException(pr#900@Gitee)
|
||||
* 【db 】 修复使用mariadb通过jdbcurl创建SimpleDataSource报NullPointException(pr#900@Gitee)
|
||||
* 【core 】 修复UrlBuilder中参数中包括"://"判断错误问题(pr#898@Gitee)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
||||
<br/>
|
||||
<p align="center">
|
||||
<a href="https://qm.qq.com/cgi-bin/qm/qr?k=QtsqXLkHpLjE99tkre19j6pjPMhSay1a&jump_from=webapi">
|
||||
<img src="https://img.shields.io/badge/QQ%E7%BE%A4%E2%91%A5-715292493-orange"/></a>
|
||||
<img src="https://img.shields.io/badge/QQ%E7%BE%A4%E2%91%A6-715292493-orange"/></a>
|
||||
</p>
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
@ -41,7 +41,7 @@
|
||||
<br/>
|
||||
<p align="center">
|
||||
<a href="https://qm.qq.com/cgi-bin/qm/qr?k=QtsqXLkHpLjE99tkre19j6pjPMhSay1a&jump_from=webapi">
|
||||
<img src="https://img.shields.io/badge/QQ%E7%BE%A4%E2%91%A5-715292493-orange"/></a>
|
||||
<img src="https://img.shields.io/badge/QQ%E7%BE%A4%E2%91%A6-715292493-orange"/></a>
|
||||
</p>
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
@ -108,8 +108,10 @@ public final class UrlBuilder implements Builder<String> {
|
||||
*/
|
||||
public static UrlBuilder ofHttp(String httpUrl, Charset charset) {
|
||||
Assert.notBlank(httpUrl, "Http url must be not blank!");
|
||||
if (!httpUrl.startsWith("http://")&&!httpUrl.startsWith("https://")) {
|
||||
httpUrl = "http://" + httpUrl.trim();
|
||||
httpUrl = StrUtil.trimStart(httpUrl);
|
||||
// issue#I66CIR
|
||||
if(false == StrUtil.startWithAnyIgnoreCase(httpUrl, "http://", "https://")){
|
||||
httpUrl = "http://" + httpUrl;
|
||||
}
|
||||
return of(httpUrl, charset);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user