Merge branch 'majst01-unescape-format-characters'

* majst01-unescape-format-characters:
  Paging link can contain format characters, unescape them first
This commit is contained in:
Jess Frazelle 2017-02-13 11:32:33 -08:00
commit 99ad8356d3
No known key found for this signature in database
GPG key ID: 18F3685C0022BFF3

View file

@ -1,6 +1,7 @@
package registry
import "github.com/peterhellberg/link"
import nurl "net/url"
type catalogResponse struct {
Repositories []string `json:"repositories"`
@ -22,7 +23,8 @@ func (r *Registry) Catalog(u string) ([]string, error) {
for _, l := range link.ParseHeader(h) {
if l.Rel == "next" {
repos, err := r.Catalog(l.URI)
unescaped, _ := nurl.QueryUnescape(l.URI)
repos, err := r.Catalog(unescaped)
if err != nil {
return nil, err
}