Skip to content

Commit a6df2ff

Browse files
authored
Encode slashes in challenge_name, closes #81
A slash in the `challenge_name` of a MapRoulette challenge is valid and therefore has to be encoded. `requests` can't do this for us because we pass it the full URL (which contains slashes that must not be encoded).
1 parent a10b1f3 commit a6df2ff

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

maproulette/api/challenge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def get_challenge_by_name(self, project_id, challenge_name):
5151
:param challenge_name: the name corresponding to the challenge
5252
:returns: the API response from the GET request
5353
"""
54-
response = self.get(endpoint=f"/project/{project_id}/challenge/{challenge_name}")
54+
response = self.get(endpoint=f"/project/{project_id}/challenge/{challenge_name.replace('/', '%2F')}")
5555
return response
5656

5757
def get_challenges_by_tags(self, challenge_tags, limit=10, page=0):

0 commit comments

Comments
 (0)