Skip to content

Commit

Permalink
Use urlencode to construct query strings
Browse files Browse the repository at this point in the history
  • Loading branch information
u10313335 committed Jun 27, 2024
1 parent d083830 commit 32a5341
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions binderhub/repoproviders.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import time
import urllib.parse
from datetime import datetime, timedelta, timezone
from urllib.parse import parse_qs, urlparse
from urllib.parse import parse_qs, urlencode, urlparse

import escapism
from prometheus_client import Gauge
Expand Down Expand Up @@ -490,11 +490,11 @@ async def get_resolved_ref(self):
if len(url_parts_1) == 2:
activity_id = url_parts_1[-1]
if activity_id:
fetch_url = (
f"{api}activity_data_show?" f"id={activity_id}&object_type=package"
fetch_url = f"{api}activity_data_show?" + urlencode(
{"id": activity_id, "object_type": "package"}
)
else:
fetch_url = f"{api}package_show?id={self.dataset_id}"
fetch_url = f"{api}package_show?" + urlencode({"id": self.dataset_id})

client = AsyncHTTPClient()
try:
Expand Down

0 comments on commit 32a5341

Please sign in to comment.