Skip to content

Commit c1c021f

Browse files
committed
fix unit test
1 parent 622e594 commit c1c021f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/migrations/migrate.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ func IsMigrateURLAllowed(remoteURL string, doer *models.User) error {
7373
}
7474

7575
hostName, _, err := net.SplitHostPort(u.Host)
76+
if err != nil {
77+
// u.Host can be "host" or "host:port"
78+
hostName = u.Host
79+
}
7680
if err != nil {
7781
return &models.ErrInvalidCloneAddr{Host: u.Host, IsURLError: true}
7882
}

0 commit comments

Comments
 (0)