Fixed bug when setting headers

The header was always being overwrited and because of that all files were
being converted to application/json. With this change it will correctly respect
the file content_type.