output(): Use better mime type for \t separator.

Fixes #79
This commit is contained in:
Christian Bläul
2018-02-02 13:49:57 +01:00
committed by Fonata
parent eedbffc375
commit d05577d303

View File

@@ -455,7 +455,10 @@ class Csv {
$flat_string = $this->unparse($data, $fields, null, null, $delimiter);
if (!is_null($filename)) {
header('Content-type: application/csv');
$mime = $delimiter === "\t" ?
'text/tab-separated-values' :
'application/csv';
header('Content-type: ' . $mime);
header('Content-Length: ' . strlen($flat_string));
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');