aboutsummaryrefslogtreecommitdiff
path: root/internal/form/repo.go
diff options
context:
space:
mode:
authorJoe Chen <jc@unknwon.io>2022-05-31 15:17:17 +0800
committerGitHub <noreply@github.com>2022-05-31 15:17:17 +0800
commit7885f454a4946c4bbec1b4f8c603b5eea7429c7f (patch)
tree00010af607268eef9f1adcb9d8f6d713f653ee34 /internal/form/repo.go
parent90bc75229726a24a28507d3e8178f86734f112e1 (diff)
webhook: revalidate local hostname before each delivery (#6988)
Diffstat (limited to 'internal/form/repo.go')
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/form/repo.go b/internal/form/repo.go
index adcbc66a..5750d78e 100644
--- a/internal/form/repo.go
+++ b/internal/form/repo.go
@@ -72,8 +72,8 @@ func (f MigrateRepo) ParseRemoteAddr(user *db.User) (string, error) {
return "", db.ErrInvalidCloneAddr{IsURLError: true}
}
- if netutil.IsLocalHostname(u.Hostname(), conf.Security.LocalNetworkAllowlist) {
- return "", db.ErrInvalidCloneAddr{IsURLError: true}
+ if netutil.IsBlockedLocalHostname(u.Hostname(), conf.Security.LocalNetworkAllowlist) {
+ return "", db.ErrInvalidCloneAddr{IsBlockedLocalAddress: true}
}
if len(f.AuthUsername)+len(f.AuthPassword) > 0 {