diff --git a/tests/integration/api_repo_archive_test.go b/tests/integration/api_repo_archive_test.go index 340ff03961f34..eecb84d5d1b89 100644 --- a/tests/integration/api_repo_archive_test.go +++ b/tests/integration/api_repo_archive_test.go @@ -41,7 +41,7 @@ func TestAPIDownloadArchive(t *testing.T) { assert.Len(t, bs, 266) // Must return a link to a commit ID as the "immutable" archive link - linkHeaderRe := regexp.MustCompile(`<(?Phttps?://.*/api/v1/repos/user2/repo1/archive/[a-f0-9]+\.tar\.gz.*)>; rel="immutable"`) + linkHeaderRe := regexp.MustCompile(`^<(https?://.*/api/v1/repos/user2/repo1/archive/[a-f0-9]+\.tar\.gz.*)>; rel="immutable"$`) m := linkHeaderRe.FindStringSubmatch(resp.Header().Get("Link")) assert.NotEmpty(t, m[1]) resp = MakeRequest(t, NewRequest(t, "GET", m[1]).AddTokenAuth(token), http.StatusOK)