diff --git a/pkg/api/controller_test.go b/pkg/api/controller_test.go index a5a849ae..f146c721 100644 --- a/pkg/api/controller_test.go +++ b/pkg/api/controller_test.go @@ -7303,7 +7303,7 @@ func TestListingTags(t *testing.T) { } else if testCase.expectedTags[len(testCase.expectedTags)-1] == alltags[len(alltags)-1] { So(actualLinkValue, ShouldEqual, "") } else { - expectedLinkValue := fmt.Sprintf("/v2/%s/tags/list?n=%s&last=%s; rel=\"next\"", + expectedLinkValue := fmt.Sprintf("; rel=\"next\"", repoName, testCase.pageSize, tags.Tags[len(tags.Tags)-1], ) So(actualLinkValue, ShouldEqual, expectedLinkValue) diff --git a/pkg/api/routes.go b/pkg/api/routes.go index 82160ef3..7c32bac2 100644 --- a/pkg/api/routes.go +++ b/pkg/api/routes.go @@ -375,7 +375,7 @@ func (rh *RouteHandler) ListTags(response http.ResponseWriter, request *http.Req stopIndex = startIndex + numTags - 1 response.Header().Set( "Link", - fmt.Sprintf("/v2/%s/tags/list?n=%d&last=%s; rel=\"next\"", + fmt.Sprintf("; rel=\"next\"", name, numTags, tags[stopIndex], diff --git a/pkg/compliance/v1_0_0/check.go b/pkg/compliance/v1_0_0/check.go index 31d5eefc..5a559393 100644 --- a/pkg/compliance/v1_0_0/check.go +++ b/pkg/compliance/v1_0_0/check.go @@ -602,8 +602,16 @@ func CheckWorkflows(t *testing.T, config *compliance.Config) { next := resp.Header().Get("Link") So(next, ShouldNotBeEmpty) - u := baseURL + strings.Split(next, ";")[0] - resp, err = resty.R().Get(u) + nextURL := strings.Split(next, ";")[0] + if strings.HasPrefix(nextURL, "<") || strings.HasPrefix(nextURL, "\"") { + nextURL = nextURL[1:] + } + if strings.HasSuffix(nextURL, ">") || strings.HasSuffix(nextURL, "\"") { + nextURL = nextURL[:len(nextURL)-1] + } + nextURL = baseURL + nextURL + + resp, err = resty.R().Get(nextURL) So(err, ShouldBeNil) So(resp.StatusCode(), ShouldEqual, http.StatusOK) next = resp.Header().Get("Link")