Fix Link headers for pagination to match RFC

Fixes part of #2002
This commit is contained in:
Joseph Schorr 2016-10-17 13:57:05 -04:00
parent 42ed8522fd
commit 18097a1bd6
2 changed files with 9 additions and 4 deletions

View file

@ -1377,11 +1377,15 @@ class V2RegistryTests(V2RegistryPullMixin, V2RegistryPushMixin, RegistryTestsMix
break
# Check the next page of results.
link = result.headers['Link']
link_header = result.headers['Link']
self.assertTrue(link_header.startswith('<'))
self.assertTrue(link_header.endswith('>; rel="next"'))
link = link_header[1:]
self.assertTrue(link.endswith('; rel="next"'))
url, _ = link.split(';')
relative_url = url[len(self.get_server_url()):]
relative_url = url[len(self.get_server_url()):-1]
encountered.update(set(result_json['tags']))