From 22ee17b5820bb68cc99f7c78374c1ae4f5041075 Mon Sep 17 00:00:00 2001 From: juanjoseruiz Date: Mon, 4 Sep 2023 14:04:16 +0200 Subject: [PATCH] fix: allow percent encoded urls --- OneflowSDK.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OneflowSDK.py b/OneflowSDK.py index bfc9377..fdfdae6 100644 --- a/OneflowSDK.py +++ b/OneflowSDK.py @@ -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): @@ -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()