Skip to content

Commit

Permalink
Fix pagination for tags list pagination for quay.io & registry.access…
Browse files Browse the repository at this point in the history
….redhat.com registries

Remove special cases for quay.io & registry.access.redhat.com:
they were added by #63 and #92, but don't seem necessary anymore:

```
$ curl -Is https://quay.io/v2/keycloak/keycloak/tags/list | grep -i link
link: </v2/keycloak/keycloak/tags/list?n=100&last=23.0.4-0>; rel="next"
```

```
$ curl -Is https://registry.access.redhat.com:443/v2/ubi8/ubi-minimal/tags/list | grep -i link
Link: </v2/ubi8/ubi-minimal/tags/list?n=100&last=8.7-1031-source>; rel="next"
```
  • Loading branch information
thomas-riccardi committed Aug 1, 2024
1 parent 2071379 commit 8980748
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/registry/registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,7 @@ def last(header)
links = parse_link_header(header)
if links[:next]
query = URI(links[:next]).query
link_key = @uri.host.eql?('quay.io') || @uri.host.eql?('registry.access.redhat.com') ? 'next_page' : 'last'
last = URI.decode_www_form(query).to_h[link_key]

last = URI.decode_www_form(query).to_h['last']
end
last
end
Expand Down

0 comments on commit 8980748

Please sign in to comment.