Skip to content

Commit

Permalink
[+]增加容错处理
Browse files Browse the repository at this point in the history
  • Loading branch information
lcvvvv committed Dec 6, 2021
1 parent 3aa9677 commit cbfc6f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/urlparse/urlparse.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ func Load(s string) (*URL, error) {
r, err := url.Parse(s)
if err != nil {
if strings.Contains(err.Error(), "first path segment in URL cannot contain colon") {
r, _ = url.Parse("http://" + s)
r, err = url.Parse("http://" + s)
if err != nil {
return nil, err
}
r.Scheme = ""
} else {
return nil, err
Expand Down

0 comments on commit cbfc6f1

Please sign in to comment.