Commit 4f1adaa
committed
Handle the pagination Link headers for _list requests
The patchwork REST API defaults to sending a maximum of 30 items for API
requests which return a list. This makes pwclient list fail to return more
than 30 items when using the REST API.
To handle this, the API includes 'Link' headers in the response which
indicate whether there is more data and what URL the data is available at.
Processing the Link header is done automatically by the requests library.
Handle this in the _list implementation by checking whether the response
had a 'next' header, and request that data as well. This allows the
pwclient to list everything instead of being limited to 30 patches.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>1 parent 4cb4036 commit 4f1adaa
1 file changed
+11
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
590 | | - | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
591 | 601 | | |
592 | 602 | | |
593 | 603 | | |
| |||
0 commit comments