Commit a42b30bd authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

fix httpx

parent 6bd781c6
Pipeline #14239 failed with stage
in 1 minute and 47 seconds
......@@ -87,10 +87,10 @@ class Forge(Links, NamedModel):
def api_req(self, url='', name=None, page=1):
logger.debug(f'requesting api {self} {url}, page {page}')
try:
return httpx.get(self.api_url() + url, {'page': page}, verify=self.verify, headers=self.headers())
return httpx.get(self.api_url() + url, params={'page': page}, verify=self.verify, headers=self.headers())
except httpx.HTTPError:
logger.error(f'requesting api {self} {url}, page {page} - SECOND TRY')
return httpx.get(self.api_url() + url, {'page': page}, verify=self.verify, headers=self.headers())
return httpx.get(self.api_url() + url, params={'page': page}, verify=self.verify, headers=self.headers())
def api_data(self, url=''):
req = self.api_req(url)
......@@ -491,12 +491,12 @@ class Repo(TimeStampedModel):
def api_req(self, url='', name=None, page=1):
logger.debug(f'requesting api {self.forge} {self.namespace} {self} {url}, page {page}')
try:
return httpx.get(self.api_url() + url, {'page': page},
return httpx.get(self.api_url() + url, params={'page': page},
verify=self.forge.verify,
headers=self.forge.headers())
except httpx.HTTPError:
logger.error(f'requesting api {self.forge} {self.namespace} {self} {url}, page {page} - SECOND TRY')
return httpx.get(self.api_url() + url, {'page': page},
return httpx.get(self.api_url() + url, params={'page': page},
verify=self.forge.verify,
headers=self.forge.headers())
......@@ -956,7 +956,7 @@ class Image(models.Model):
headers = {}
if not self.robotpkg.project.public:
image_name = self.get_image_name().split('/', maxsplit=1)[1].split(':')[0]
token = httpx.get(f'{self.robotpkg.project.main_forge.url}/jwt/auth', {
token = httpx.get(f'{self.robotpkg.project.main_forge.url}/jwt/auth', params={
'client_id': 'docker',
'offline_token': True,
'service': 'container_registry',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment