Merb, Safari and “Cannot decode raw data”
Today I was attempting to get Merb to output a comma-delimited file of data dumped from the database. In config/init.rb I’d added:
Merb.add_mime_type( :csv, :to_csv, %w[application/csv], "Content-Encoding" => "gzip")
but I kept getting this error from Safari: cannot decode raw data.
Turns out the gzip encoding was mucking up the data. Using this line instead produced the desired outcome:
Merb.add_mime_type( :csv, :to_csv, %w[application/csv] )
chris on April 30th 2009 in /dev/random
