Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Paging not working properly #27

Open
samifruit514 opened this issue Jan 11, 2017 · 2 comments
Open

Paging not working properly #27

samifruit514 opened this issue Jan 11, 2017 · 2 comments

Comments

@samifruit514
Copy link

Hello,

I have a lot of repositories in my docker registry. lets say if have this tool:

package main

import (
	"fmt"
	"github.com/heroku/docker-registry-client/registry"
)

func main() {
	url := "https://testrepo.com/"
	username := "" // anonymous
	pass := ""
	hub, err := registry.New(url, username, pass)
	if err != nil {
		fmt.Print(err.Error())
	} else {
		repositories, err := hub.Repositories()
		if err != nil {
			fmt.Print(err.Error())
		}
		fmt.Printf("%v", repositories)
	}
}

When I run this, I get the following error:

Get /v2/_catalog?last=lastrepo&n=100: unsupported protocol scheme ""[]

From what I understand, the nextlink returned in the headers do not have the scheme and host part. I think that part should be kept somewhere in json.go so the getPaginatedJson method returns the full URL

@paulbellamy
Copy link

Just a note that this also happens against quay.io, who return next links like:

Link: </v2/weaveworks/fluxsvc/tags/list?next_page=...&n=50>; rel="next"

@stevenbower
Copy link

Pushed new PR #38 that fixes this issue in a more "complete" way thank PR #29

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants