ignore DNS error when doing migration allow/block check (#19566)

Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
wxiaoguangand6543 authored and GitHub committed 2022-05-02 12:02:17 +08:00
1 parent 05234adfa8
commit 71bafa0263
2 files changed
+3 -8

No files matched your search

+3 -4
View File
@@ -81,10 +81,9 @@ func IsMigrateURLAllowed(remoteURL string, doer *user_model.User) error {
err = nil //nolint
hostName = u.Host
}
addrList, err := net.LookupIP(hostName)
if err != nil {
return &models.ErrInvalidCloneAddr{Host: u.Host, NotResolvedIP: true}
}
// some users only use proxy, there is no DNS resolver. it's safe to ignore the LookupIP error
addrList, _ := net.LookupIP(hostName)
var ipAllowed bool
var ipBlocked bool