Commit bd4f36f0 authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot
Browse files

Merge topic 'support-links-header-keyset-pagination'

e83b884e

 api/paged: support the Links header
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Tested-by: Chris Pick's avatarChris Pick <kitware@chrispick.com>
Acked-by: Chris Pick's avatarChris Pick <kitware@chrispick.com>
Merge-request: !256
parents 9b5b799c e83b884e
......@@ -23,6 +23,8 @@
## Fixes
* Added pagination support to `api::projects::labels::Labels`
* Keyset pagination also supports the to-be-removed (14.0) `Links` HTTP
header.
# v0.1301.0
......
......@@ -269,9 +269,12 @@ where
}
fn next_page_from_headers(headers: &HeaderMap) -> Result<Option<Url>, PaginationError> {
headers
.get_all(reqwest::header::LINK)
.iter()
let link_headers = headers.get_all(reqwest::header::LINK).iter();
// GitLab 14.0 will deprecate this header in preference for the W3C spec's `Link` header. Make
// it less preferred to it in anticipation for this change.
let links_headers = headers.get_all("Links").iter();
link_headers
.chain(links_headers)
.map(|link| {
let value = link
.to_str()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment