Skip to content

Commit

Permalink
use path from page in file_api_url, when page is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
trondth committed Feb 7, 2025
1 parent 7c65625 commit 64ac150
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tsdapiclient/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ def file_api_url(
if formid:
endpoint = f'{formid}/{endpoint}'
scheme = 'http' if env == 'dev' else 'https'
if page is not None:
return f"{scheme}://{host}/{page}"
path = os.path.normpath(f"{host}/{API_VERSION}/{pnum}/{service}/{endpoint}")
url = f'{scheme}://{path}'
if url.endswith('/'):
Expand All @@ -101,8 +103,6 @@ def file_api_url(
query_dict = {}
if per_page:
query_dict["per_page"] = per_page
if page is not None:
query_dict["page"] = page
if len(query_dict) > 0:
url += f'?{urlencode(query_dict)}'

Expand Down

0 comments on commit 64ac150

Please sign in to comment.