lib/cloudinary/uploader.rb in cloudinary-1.19.0 vs lib/cloudinary/uploader.rb in cloudinary-1.20.0

- old
+ new

@@ -40,10 +40,11 @@ :eval => options[:eval], :face_coordinates => Cloudinary::Utils.encode_double_array(options[:face_coordinates]), :faces => Cloudinary::Utils.as_safe_bool(options[:faces]), :folder => options[:folder], :format => options[:format], + :filename_override => options[:filename_override], :headers => build_custom_headers(options[:headers]), :image_metadata => Cloudinary::Utils.as_safe_bool(options[:image_metadata]), :invalidate => Cloudinary::Utils.as_safe_bool(options[:invalidate]), :moderation => options[:moderation], :notification_url => options[:notification_url], @@ -339,13 +340,14 @@ params, non_signable = yield non_signable ||= [] unless options[:unsigned] - api_key = options[:api_key] || Cloudinary.config.api_key || raise(CloudinaryException, "Must supply api_key") - api_secret = options[:api_secret] || Cloudinary.config.api_secret || raise(CloudinaryException, "Must supply api_secret") - params[:signature] = Cloudinary::Utils.api_sign_request(params.reject { |k, v| non_signable.include?(k) }, api_secret) - params[:api_key] = api_key + api_key = options[:api_key] || Cloudinary.config.api_key || raise(CloudinaryException, "Must supply api_key") + api_secret = options[:api_secret] || Cloudinary.config.api_secret || raise(CloudinaryException, "Must supply api_secret") + signature_algorithm = options[:signature_algorithm] + params[:signature] = Cloudinary::Utils.api_sign_request(params.reject { |k, v| non_signable.include?(k) }, api_secret, signature_algorithm) + params[:api_key] = api_key end proxy = options[:api_proxy] || Cloudinary.config.api_proxy timeout = options.fetch(:timeout) { Cloudinary.config.to_h.fetch(:timeout, 60) } result = nil