lib/cloudinary/uploader.rb in cloudinary-1.0.60 vs lib/cloudinary/uploader.rb in cloudinary-1.0.61
- old
+ new
@@ -40,10 +40,10 @@
end
def self.upload(file, options={})
call_api("upload", options) do
params = build_upload_params(options)
- if file.respond_to?(:read) || file =~ /^https?:|^s3:|^data:image\/\w*;base64,([a-zA-Z0-9\/+\n=]+)$/
+ if file.respond_to?(:read) || file =~ /^https?:|^s3:|^data:[^;]*;base64,([a-zA-Z0-9\/+\n=]+)$/
params[:file] = file
else
params[:file] = File.open(file, "rb")
end
[params, [:file]]