Handling a mix of image proxy options.

This commit is contained in:
Samuel Clay 2019-12-25 18:15:50 -05:00
parent 7baa187566
commit 0d9f787d89

View file

@ -396,6 +396,7 @@ def create_imageproxy_signed_url(base_url, hmac_key, url, options=None):
str: A full url that can be used to serve the proxied image
"""
if not options: options = []
if isinstance(options, int): options = [str(options)]
if not isinstance(options, list): options = [options]
base_url = base_url.rstrip('/')
signature = base64.urlsafe_b64encode(hmac.new(hmac_key, msg=url, digestmod=hashlib.sha256).digest())