diff options
author | Michael Rowley <michaellrowley@protonmail.com> | 2022-03-08 03:34:53 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-08 11:34:53 +0800 |
commit | 242deca524dbf922bfb08dadd65455164b9e663e (patch) | |
tree | b8110c947dba99cf3e8115219a440f79f19bcc14 /internal/route/repo/webhook_test.go | |
parent | bb19f52c05e212b9358f9efaa897120dbdf9d0ab (diff) |
security: fix SSRF in repository migration (#6812)
Co-authored-by: Joe Chen <jc@unknwon.io>
Diffstat (limited to 'internal/route/repo/webhook_test.go')
-rw-r--r-- | internal/route/repo/webhook_test.go | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/internal/route/repo/webhook_test.go b/internal/route/repo/webhook_test.go index 182c6eed..d10a6fcc 100644 --- a/internal/route/repo/webhook_test.go +++ b/internal/route/repo/webhook_test.go @@ -13,25 +13,6 @@ import ( "gogs.io/gogs/internal/mocks" ) -func Test_isLocalHostname(t *testing.T) { - tests := []struct { - hostname string - want bool - }{ - {hostname: "localhost", want: true}, - {hostname: "127.0.0.1", want: true}, - {hostname: "::1", want: true}, - {hostname: "0:0:0:0:0:0:0:1", want: true}, - - {hostname: "gogs.io", want: false}, - } - for _, test := range tests { - t.Run("", func(t *testing.T) { - assert.Equal(t, test.want, isLocalHostname(test.hostname)) - }) - } -} - func Test_validateWebhook(t *testing.T) { l := &mocks.Locale{ MockLang: "en", |