fix: gitea api pagination
This commit is contained in:
parent
4bca796b43
commit
67f3758f7a
1 changed files with 2 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/scornet256/go-logger"
|
"github.com/scornet256/go-logger"
|
||||||
|
|
@ -135,7 +136,7 @@ func (c *GiteaClient) fetchRepositoryPage(ctx context.Context, options GiteaAPIO
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for more pages
|
// check for more pages
|
||||||
hasMore := len(giteaRepos) == options.Limit
|
hasMore := strings.Contains(resp.Header.Get("Link"), `rel="next"`)
|
||||||
|
|
||||||
return giteaRepos, hasMore, nil
|
return giteaRepos, hasMore, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue