aboutsummaryrefslogtreecommitdiffstats
path: root/services/migrations/migrate.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/migrations/migrate.go')
-rw-r--r--services/migrations/migrate.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/services/migrations/migrate.go b/services/migrations/migrate.go
index 961abe16f4..eba9c79df5 100644
--- a/services/migrations/migrate.go
+++ b/services/migrations/migrate.go
@@ -75,11 +75,9 @@ func IsMigrateURLAllowed(remoteURL string, doer *user_model.User) error {
return &git.ErrInvalidCloneAddr{Host: u.Host, IsProtocolInvalid: true, IsPermissionDenied: true, IsURLError: true}
}
- hostName, _, err := net.SplitHostPort(u.Host)
- if err != nil {
- // u.Host can be "host" or "host:port"
- err = nil //nolint
- hostName = u.Host
+ hostName, _, errIgnored := net.SplitHostPort(u.Host)
+ if errIgnored != nil {
+ hostName = u.Host // u.Host can be "host" or "host:port"
}
// some users only use proxy, there is no DNS resolver. it's safe to ignore the LookupIP error