diff --git a/routers/api/v1/repo/git_ref.go b/routers/api/v1/repo/git_ref.go index f042e9e344b6f..f6e807d4c02c9 100644 --- a/routers/api/v1/repo/git_ref.go +++ b/routers/api/v1/repo/git_ref.go @@ -76,6 +76,7 @@ func GetGitRefs(ctx *context.APIContext) { } func getGitRefsInternal(ctx *context.APIContext, filter string) { + listOptions := utils.GetListOptions(ctx) refs, lastMethodName, err := utils.GetGitRefs(ctx, filter) if err != nil { ctx.APIErrorInternal(fmt.Errorf("%s: %w", lastMethodName, err)) @@ -104,5 +105,7 @@ func getGitRefsInternal(ctx *context.APIContext, filter string) { ctx.JSON(http.StatusOK, &apiRefs[0]) return } + ctx.SetLinkHeader(len(apiRefs), listOptions.PageSize) + ctx.SetTotalCountHeader(int64(len(apiRefs))) ctx.JSON(http.StatusOK, &apiRefs) }