@@ -417,7 +417,7 @@ exports.url = (public_id, options = {}) ->
417417 if sign_url
418418 to_sign = [transformation, source_to_sign].filter ((part ) -> part? && part != ' ' ).join (' /' )
419419 shasum = crypto .createHash (' sha1' )
420- shasum .update (utf8_encode (to_sign + api_secret))
420+ shasum .update (utf8_encode (to_sign + api_secret), ' binary ' )
421421 signature = shasum .digest (' base64' ).replace (/ \/ / g , ' _' ).replace (/ \+ / g , ' -' ).substring (0 , 8 )
422422 signature = " s--#{ signature} --"
423423
@@ -597,7 +597,7 @@ exports.signed_preloaded_image = (result) ->
597597exports .api_sign_request = (params_to_sign , api_secret ) ->
598598 to_sign = _ .sortBy (" #{ k} =#{ utils .build_array (v).join (" ," )} " for k, v of params_to_sign when v? , _ .identity ).join (" &" )
599599 shasum = crypto .createHash (' sha1' )
600- shasum .update (utf8_encode (to_sign + api_secret))
600+ shasum .update (utf8_encode (to_sign + api_secret), ' binary ' )
601601 shasum .digest (' hex' )
602602
603603exports .clear_blank = (hash ) ->
@@ -626,7 +626,7 @@ exports.webhook_signature = (data, timestamp, options = {}) ->
626626 throw " Must supply timestamp" unless timestamp
627627 api_secret = options .api_secret ? config ().api_secret ? throw (" Must supply api_secret" )
628628 shasum = crypto .createHash (' sha1' )
629- shasum .update (data + timestamp + api_secret)
629+ shasum .update (data + timestamp + api_secret, ' binary ' )
630630 shasum .digest (' hex' )
631631
632632exports .process_request_params = (params , options ) ->
@@ -847,6 +847,8 @@ exports.build_explicit_api_params = (public_id, options = {})->
847847 face_coordinates : options .face_coordinates && utils .encode_double_array (options .face_coordinates )
848848 headers : build_custom_headers (options .headers )
849849 invalidate : utils .as_safe_bool (options .invalidate )
850+ moderation : options .moderation
851+ phash : utils .as_safe_bool (options .phash )
850852 public_id : public_id
851853 responsive_breakpoints : utils .generate_responsive_breakpoints_string (options .responsive_breakpoints )
852854 tags : options .tags && utils .build_array (options .tags ).join (" ," )
0 commit comments