mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-28 21:41:22 +08:00
Use hostmatcher
to replace matchlist
, improve security (#17605)
Use hostmacher to replace matchlist. And we introduce a better DialContext to do a full host/IP check, otherwise the attackers can still bypass the allow/block list by a 302 redirection.
This commit is contained in:
@ -47,7 +47,7 @@ func TestMirrorPull(t *testing.T) {
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
mirror, err := repository.MigrateRepositoryGitData(ctx, user, mirrorRepo, opts)
|
||||
mirror, err := repository.MigrateRepositoryGitData(ctx, user, mirrorRepo, opts, nil)
|
||||
assert.NoError(t, err)
|
||||
|
||||
gitRepo, err := git.OpenRepository(repoPath)
|
||||
|
Reference in New Issue
Block a user