mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 12:28:01 +08:00
feat(pagination): make sure the URL to in the link header is inside angle brackets (#2116)
Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
This commit is contained in:
@@ -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("</v2/%s/tags/list?n=%s&last=%s>; rel=\"next\"",
|
||||
repoName, testCase.pageSize, tags.Tags[len(tags.Tags)-1],
|
||||
)
|
||||
So(actualLinkValue, ShouldEqual, expectedLinkValue)
|
||||
|
||||
+1
-1
@@ -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("</v2/%s/tags/list?n=%d&last=%s>; rel=\"next\"",
|
||||
name,
|
||||
numTags,
|
||||
tags[stopIndex],
|
||||
|
||||
Reference in New Issue
Block a user