fix strip slash in domain

This commit is contained in:
Cayo Puigdefabregas 2023-09-28 08:17:47 +02:00
parent dce2873158
commit 843324bd17
4 changed files with 8 additions and 0 deletions

View File

@ -105,3 +105,6 @@ class DevicehubConfig(Config):
OAUTH2_JWT_ISS = config('OAUTH2_JWT_ISS', '') OAUTH2_JWT_ISS = config('OAUTH2_JWT_ISS', '')
OAUTH2_JWT_KEY = config('OAUTH2_JWT_KEY', None) OAUTH2_JWT_KEY = config('OAUTH2_JWT_KEY', None)
OAUTH2_JWT_ALG = config('OAUTH2_JWT_ALG', 'HS256') OAUTH2_JWT_ALG = config('OAUTH2_JWT_ALG', 'HS256')
if API_DLT:
API_DLT = API_DLT.strip("/")

View File

@ -21,6 +21,9 @@ class InsertMember:
print("Error: you need a entry var API_RESOLVER in .env") print("Error: you need a entry var API_RESOLVER in .env")
return return
api = api.strip("/")
domain = domain.strip("/")
data = {"url": domain} data = {"url": domain}
url = api + '/registerURL' url = api + '/registerURL'
res = requests.post(url, json=data) res = requests.post(url, json=data)

View File

@ -19,6 +19,8 @@ class GetMembers:
print("Error: you need a entry var API_RESOLVER in .env") print("Error: you need a entry var API_RESOLVER in .env")
return return
api = api.strip("/")
url = api + '/getAll' url = api + '/getAll'
res = requests.get(url) res = requests.get(url)
if res.status_code != 200: if res.status_code != 200: