We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c5957be + 0c31def commit 7ee9b16Copy full SHA for 7ee9b16
hutool-core/src/main/java/cn/hutool/core/net/url/UrlBuilder.java
@@ -108,9 +108,7 @@ public static UrlBuilder ofHttp(String httpUrl) {
108
*/
109
public static UrlBuilder ofHttp(String httpUrl, Charset charset) {
110
Assert.notBlank(httpUrl, "Http url must be not blank!");
111
-
112
- final int sepIndex = httpUrl.indexOf("://");
113
- if (sepIndex < 0) {
+ if (!httpUrl.startsWith("http://")&&!httpUrl.startsWith("https://")) {
114
httpUrl = "http://" + httpUrl.trim();
115
}
116
return of(httpUrl, charset);
0 commit comments