Skip to content

Commit af2cb2c

Browse files
committed
fix unit test
1 parent ba3e16c commit af2cb2c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

integrations/api_repo_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,10 @@ func TestAPIRepoMigrate(t *testing.T) {
331331
switch respJSON["message"] {
332332
case "Remote visit addressed rate limitation.":
333333
t.Log("test hit github rate limitation")
334-
case "You are not allowed to import from private IPs.":
334+
case "You can not import from disallowed hosts.":
335335
assert.EqualValues(t, "private-ip", testCase.repoName)
336336
default:
337-
t.Errorf("unexpected error '%v' on url '%s'", respJSON["message"], testCase.cloneURL)
337+
assert.Fail(t, "unexpected error '%v' on url '%s'", respJSON["message"], testCase.cloneURL)
338338
}
339339
} else {
340340
assert.EqualValues(t, testCase.expectedStatus, resp.Code)

modules/migrations/migrate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ func Init() error {
477477
}
478478
if setting.Migrations.AllowLocalNetworks {
479479
allowList.AppendPattern(hostmatcher.MatchBuiltinPrivate)
480+
allowList.AppendPattern(hostmatcher.MatchBuiltinLoopback)
480481
}
481482
return nil
482483
}

0 commit comments

Comments
 (0)