mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复UrlBuilder中参数中包括"://"判断错误问题
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user