jeygeethan/activestorage-backblaze

Missing the content-type when put object

Closed this issue · 1 comments

When put_object, we missed the options that has the content_type of file.
https://github.com/jeygeethan/activestorage-backblaze/blob/master/lib/active_storage/service/backblaze_service.rb#L19-L31

  def upload(key, io, checksum: nil, **options)
    instrument :upload, { key: key, checksum: checksum } do
      begin
        io.binmode
        io.rewind
        @connection.put_object(@bucket_name, key, io.read)
      rescue => e
        puts "ERROR - 101"
        puts e.inspect
        raise ActiveStorage::IntegrityError
      end
    end
  end

It should be

@connection.put_object(@bucket_name, key, io.read, options)

Closing this, since merged.