Skip to content

Commit

Permalink
fix: allow percent encoded urls
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjoseruiz committed Sep 4, 2023
1 parent 412388b commit 22ee17b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OneflowSDK.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import requests, hmac, hashlib, datetime
from requests.adapters import HTTPAdapter
from urllib3.util import Retry

from urllib.parse import unquote

class OneflowSDK:
def __init__(self, url, token, secret, options=None):
Expand Down Expand Up @@ -40,7 +40,7 @@ def requests_retry_session(self):

def create_headers(self, method, path):
timestamp = datetime.datetime.now().isoformat()
string_to_sign = method.upper() + " " + path + " " + timestamp
string_to_sign = method.upper() + " " + unquote(path) + " " + timestamp
signature = hmac.new(
bytes(self.secret, "utf-8"), bytes(string_to_sign, "utf-8"), hashlib.sha256
).hexdigest()
Expand Down

0 comments on commit 22ee17b

Please sign in to comment.