aboutsummaryrefslogtreecommitdiff
path: root/internal/route/api/v1/repo
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/route/api/v1/repo
parent90bc75229726a24a28507d3e8178f86734f112e1 (diff)
webhook: revalidate local hostname before each delivery (#6988)
Diffstat (limited to 'internal/route/api/v1/repo')
-rw-r--r--internal/route/api/v1/repo/repo.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/route/api/v1/repo/repo.go b/internal/route/api/v1/repo/repo.go
index 11548ec4..682d2a3b 100644
--- a/internal/route/api/v1/repo/repo.go
+++ b/internal/route/api/v1/repo/repo.go
@@ -248,6 +248,8 @@ func Migrate(c *context.APIContext, f form.MigrateRepo) {
c.ErrorStatus(http.StatusUnprocessableEntity, errors.New("You are not allowed to import local repositories."))
case addrErr.IsInvalidPath:
c.ErrorStatus(http.StatusUnprocessableEntity, errors.New("Invalid local path, it does not exist or not a directory."))
+ case addrErr.IsBlockedLocalAddress:
+ c.ErrorStatus(http.StatusUnprocessableEntity, errors.New("Clone address resolved to a local network address that is implicitly blocked."))
default:
c.Error(err, "unexpected error")
}