mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 01:57:20 +00: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