mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 08:13:16 +00:00
Update ApiV1Controller, fix pagination header. Fixes #3354
This commit is contained in:
parent
49ceed7169
commit
4fe07e6fe2
1 changed files with 9 additions and 9 deletions
|
@ -1897,15 +1897,15 @@ class ApiV1Controller extends Controller
|
|||
}
|
||||
|
||||
if($maxId) {
|
||||
$link = '<'.$baseUrl.'max_id='.$maxId.'>; rel="next"';
|
||||
$link = '<'.$baseUrl.'max_id='.$minId.'>; rel="next"';
|
||||
}
|
||||
|
||||
if($minId) {
|
||||
$link = '<'.$baseUrl.'min_id='.$minId.'>; rel="prev"';
|
||||
$link = '<'.$baseUrl.'min_id='.$maxId.'>; rel="prev"';
|
||||
}
|
||||
|
||||
if($maxId && $minId) {
|
||||
$link = '<'.$baseUrl.'max_id='.$maxId.'>; rel="next",<'.$baseUrl.'min_id='.$minId.'>; rel="prev"';
|
||||
$link = '<'.$baseUrl.'max_id='.$minId.'>; rel="next",<'.$baseUrl.'min_id='.$maxId.'>; rel="prev"';
|
||||
}
|
||||
|
||||
$headers = isset($link) ? ['Link' => $link] : [];
|
||||
|
@ -2019,15 +2019,15 @@ class ApiV1Controller extends Controller
|
|||
}
|
||||
|
||||
if($maxId) {
|
||||
$link = '<'.$baseUrl.'max_id='.$maxId.'>; rel="next"';
|
||||
$link = '<'.$baseUrl.'max_id='.$minId.'>; rel="next"';
|
||||
}
|
||||
|
||||
if($minId) {
|
||||
$link = '<'.$baseUrl.'min_id='.$minId.'>; rel="prev"';
|
||||
$link = '<'.$baseUrl.'min_id='.$maxId.'>; rel="prev"';
|
||||
}
|
||||
|
||||
if($maxId && $minId) {
|
||||
$link = '<'.$baseUrl.'max_id='.$maxId.'>; rel="next",<'.$baseUrl.'min_id='.$minId.'>; rel="prev"';
|
||||
$link = '<'.$baseUrl.'max_id='.$minId.'>; rel="next",<'.$baseUrl.'min_id='.$maxId.'>; rel="prev"';
|
||||
}
|
||||
|
||||
$headers = isset($link) ? ['Link' => $link] : [];
|
||||
|
@ -2136,15 +2136,15 @@ class ApiV1Controller extends Controller
|
|||
}
|
||||
|
||||
if($maxId) {
|
||||
$link = '<'.$baseUrl.'max_id='.$maxId.'>; rel="next"';
|
||||
$link = '<'.$baseUrl.'max_id='.$minId.'>; rel="next"';
|
||||
}
|
||||
|
||||
if($minId) {
|
||||
$link = '<'.$baseUrl.'min_id='.$minId.'>; rel="prev"';
|
||||
$link = '<'.$baseUrl.'min_id='.$maxId.'>; rel="prev"';
|
||||
}
|
||||
|
||||
if($maxId && $minId) {
|
||||
$link = '<'.$baseUrl.'max_id='.$maxId.'>; rel="next",<'.$baseUrl.'min_id='.$minId.'>; rel="prev"';
|
||||
$link = '<'.$baseUrl.'max_id='.$minId.'>; rel="next",<'.$baseUrl.'min_id='.$maxId.'>; rel="prev"';
|
||||
}
|
||||
|
||||
$headers = isset($link) ? ['Link' => $link] : [];
|
||||
|
|
Loading…
Reference in a new issue