Skip to content

Commit 7ee9b16

Browse files
loolygitee-org
authored andcommitted
!898 修复Gitee issue #I66CIR
Merge pull request !898 from Tom Xin/v5-dev-fix_#I66CIR
2 parents c5957be + 0c31def commit 7ee9b16

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

hutool-core/src/main/java/cn/hutool/core/net/url/UrlBuilder.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,7 @@ public static UrlBuilder ofHttp(String httpUrl) {
108108
*/
109109
public static UrlBuilder ofHttp(String httpUrl, Charset charset) {
110110
Assert.notBlank(httpUrl, "Http url must be not blank!");
111-
112-
final int sepIndex = httpUrl.indexOf("://");
113-
if (sepIndex < 0) {
111+
if (!httpUrl.startsWith("http://")&&!httpUrl.startsWith("https://")) {
114112
httpUrl = "http://" + httpUrl.trim();
115113
}
116114
return of(httpUrl, charset);

0 commit comments

Comments
 (0)