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

Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
wxiaoguang 2022-05-02 12:02:17 +08:00 committed by GitHub
parent 05234adfa8
commit 71bafa0263
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions

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