From 77c04b1acb2815290bcd6f50c37d75329409e9d3 Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Wed, 3 Aug 2022 17:22:20 +0200 Subject: [PATCH] refactor(client): remove handling for incorrect link header This was a quirk only present in GitLab 13.0 and fixed with 13.1. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/33714 and https://gitlab.com/gitlab-org/gitlab/-/issues/218504 for more context. --- gitlab/client.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gitlab/client.py b/gitlab/client.py index e3290e145..db2ace5ff 100644 --- a/gitlab/client.py +++ b/gitlab/client.py @@ -1135,13 +1135,8 @@ def _query( query_data = query_data or {} result = self._gl.http_request("get", url, query_data=query_data, **kwargs) try: - links = result.links - if links: - next_url = links["next"]["url"] - else: - next_url = requests.utils.parse_header_links(result.headers["links"])[ - 0 - ]["url"] + next_url = result.links["next"]["url"] + # if the next url is different with user provided server URL # then give a warning it may because of misconfiguration # but if the option to fix provided then just reconstruct it