mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 10:18:38 +00:00
Backport #19120 Backport #19099 Backport #18874 Backport #18420 Backport #19128 Backport #18270 Bump to build with go1.18 Co-authored-by: techknowlogick <techknowlogick@gitea.io> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Jelle Hulter <jellehulter@gmail.com>
This commit is contained in:
@@ -8,8 +8,6 @@ import (
|
||||
"net"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
)
|
||||
|
||||
// HostMatchList is used to check if a host or IP is in a list.
|
||||
@@ -104,11 +102,11 @@ func (hl *HostMatchList) checkIP(ip net.IP) bool {
|
||||
for _, builtin := range hl.builtins {
|
||||
switch builtin {
|
||||
case MatchBuiltinExternal:
|
||||
if ip.IsGlobalUnicast() && !util.IsIPPrivate(ip) {
|
||||
if ip.IsGlobalUnicast() && !ip.IsPrivate() {
|
||||
return true
|
||||
}
|
||||
case MatchBuiltinPrivate:
|
||||
if util.IsIPPrivate(ip) {
|
||||
if ip.IsPrivate() {
|
||||
return true
|
||||
}
|
||||
case MatchBuiltinLoopback:
|
||||
|
Reference in New Issue
Block a user