Skip to content

Commit 2112851

Browse files
author
Bartek Kwiecien
committed
Use urlsafe b64 encoding
1 parent 2710c28 commit 2112851

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

filestack/uploads/external_url.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def build_store_task(store_params):
2525

2626
def upload_external_url(url, apikey, store_params=None, security=None):
2727
store_task = build_store_task(store_params or {})
28-
encoded_url = 'b64://{}'.format(base64.b64encode(url.encode()).decode())
28+
encoded_url = 'b64://{}'.format(base64.urlsafe_b64encode(url.encode()).decode())
2929
url_elements = [config.CDN_URL, apikey, store_task, encoded_url]
3030

3131
if security is not None:

tests/uploads/test_upload_external_url.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from filestack.uploads.external_url import upload_external_url
1010

1111
url = 'http://image.url'
12-
encoded_url = 'b64://{}'.format(base64.b64encode(url.encode()).decode())
12+
encoded_url = 'b64://{}'.format(base64.urlsafe_b64encode(url.encode()).decode())
1313
apikey = 'TESTAPIKEY'
1414

1515

0 commit comments

Comments
 (0)