mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
修复Gitee issue #I66CIR
This commit is contained in:
parent
ecde508346
commit
0c31def7b8
@ -108,9 +108,7 @@ public final class UrlBuilder implements Builder<String> {
|
|||||||
*/
|
*/
|
||||||
public static UrlBuilder ofHttp(String httpUrl, Charset charset) {
|
public static UrlBuilder ofHttp(String httpUrl, Charset charset) {
|
||||||
Assert.notBlank(httpUrl, "Http url must be not blank!");
|
Assert.notBlank(httpUrl, "Http url must be not blank!");
|
||||||
|
if (!httpUrl.startsWith("http://")&&!httpUrl.startsWith("https://")) {
|
||||||
final int sepIndex = httpUrl.indexOf("://");
|
|
||||||
if (sepIndex < 0) {
|
|
||||||
httpUrl = "http://" + httpUrl.trim();
|
httpUrl = "http://" + httpUrl.trim();
|
||||||
}
|
}
|
||||||
return of(httpUrl, charset);
|
return of(httpUrl, charset);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user