Skip to content

Commit

Permalink
fix: url encode to handle slash in creator
Browse files Browse the repository at this point in the history
  • Loading branch information
andyantrim committed Oct 24, 2024
1 parent 41bb988 commit e918d2f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nyx_client/nyx_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import importlib.metadata
import json
import logging
from urllib.parse import quote_plus
from collections.abc import Sequence
from enum import Enum, unique
from typing import Any, Literal
Expand Down Expand Up @@ -519,9 +520,12 @@ def get_data(

def get_my_data_by_name(self, name: str) -> Data:
"""Retrieve a data based on its unique name.
This only works on data you own
Args:
name: The data unique name.
Returns:
The `Data` instance identified with the provided name.
"""
Expand Down Expand Up @@ -760,4 +764,6 @@ def unsubscribe(self, data: Data):
Raises:
requests.HTTPError: If the API request fails.
"""
self._nyx_delete(f"{NYX_PURCHASES_TRANSACTIONS_ENDPOINT}/{data.creator}/{data.name}")
# Double encode `/` for community mode
creator = quote_plus(quote_plus(data.creator))
self._nyx_delete(f"{NYX_PURCHASES_TRANSACTIONS_ENDPOINT}/{creator}/{data.name}")

0 comments on commit e918d2f

Please sign in to comment.