Commit 8258436
authored
Handle paginated registry metadata responses (#8219)
In [4.1 List Package
Releases](https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/PackageRegistry/Registry.md#41-list-package-releases)
it is stated that a server may respond with a `Link` header that
contains a pointer to a subsequent page of results. SwiftPM is not
checking for the `next` link in the `Link` header and so if a registry
returns paginated results, only the first page of versions is searched
when resolving. This would result in a "version not found" error when in
reality the version is present in a subsequent page of results.
Respect the `next` link in the `Link` header by loading the next page of
results and building up a list of versions, continuing until there is no
`next` link present in the `Link` header of the last result.
Registry servers that serve paginated results now have all their results
read.
Issue: #82151 parent 4878aba commit 8258436
File tree
3 files changed
+421
-105
lines changed- Sources
- PackageMetadata
- PackageRegistry
- Tests/PackageRegistryTests
3 files changed
+421
-105
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
| 355 | + | |
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| |||
0 commit comments