Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Nov 10, 2021
1 parent ba3e16c commit af2cb2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions integrations/api_repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,10 @@ func TestAPIRepoMigrate(t *testing.T) {
switch respJSON["message"] {
case "Remote visit addressed rate limitation.":
t.Log("test hit github rate limitation")
case "You are not allowed to import from private IPs.":
case "You can not import from disallowed hosts.":
assert.EqualValues(t, "private-ip", testCase.repoName)
default:
t.Errorf("unexpected error '%v' on url '%s'", respJSON["message"], testCase.cloneURL)
assert.Fail(t, "unexpected error '%v' on url '%s'", respJSON["message"], testCase.cloneURL)
}
} else {
assert.EqualValues(t, testCase.expectedStatus, resp.Code)
Expand Down
1 change: 1 addition & 0 deletions modules/migrations/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ func Init() error {
}
if setting.Migrations.AllowLocalNetworks {
allowList.AppendPattern(hostmatcher.MatchBuiltinPrivate)
allowList.AppendPattern(hostmatcher.MatchBuiltinLoopback)
}
return nil
}

0 comments on commit af2cb2c

Please sign in to comment.