aboutsummaryrefslogtreecommitdiff
path: root/internal/route/repo/webhook.go
diff options
context:
space:
mode:
authorJoe Chen <jc@unknwon.io>2022-03-14 22:06:08 +0800
committerGitHub <noreply@github.com>2022-03-14 22:06:08 +0800
commit714383a063f64fcc7c6a458182c4f9cf5a46df66 (patch)
treeebed76f917e9817cd78c4dda07813f93f3bb16bd /internal/route/repo/webhook.go
parenta2c632526111b3333de482c69709a7ca70a173f8 (diff)
conf: add allowlist for accessing local network (#6842)
Diffstat (limited to 'internal/route/repo/webhook.go')
-rw-r--r--internal/route/repo/webhook.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/route/repo/webhook.go b/internal/route/repo/webhook.go
index 77696bbc..c7e99db6 100644
--- a/internal/route/repo/webhook.go
+++ b/internal/route/repo/webhook.go
@@ -128,7 +128,7 @@ func validateWebhook(actor *db.User, l macaron.Locale, w *db.Webhook) (field, ms
return "PayloadURL", l.Tr("repo.settings.webhook.err_cannot_parse_payload_url", err), false
}
- if netutil.IsLocalHostname(payloadURL.Hostname()) {
+ if netutil.IsLocalHostname(payloadURL.Hostname(), conf.Security.LocalNetworkAllowlist) {
return "PayloadURL", l.Tr("repo.settings.webhook.err_cannot_use_local_addresses"), false
}
}