SkygearIO / py-skygear

Skygear Cloud Code Python SDK
https://skygear.io
Other
8 stars 20 forks source link

Asset signer should percent-escape its argument #227

Closed louischan-oursky closed 6 years ago

louischan-oursky commented 6 years ago

(Describe the issue here)

Expected Results

The signed URL should be a valid URL.

Actual Results

If the given asset name contains some characters that required to be percent-escaped, those characters are left unescaped in the signed URL, resulting in an invalid URL.

Steps to reproduce

Python 3.5.5 (default, Mar 14 2018, 17:55:25) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from skygear.options import parse_args
>>> parse_args()
redacted
>>> from skygear.asset import get_signer
>>> signer = get_signer()
>>> signer.sign('This is a good name.')
'http://192.168.1.127:3000/files/This is a good name.'
carmenlau commented 6 years ago

Merged via 1332579