diff --git a/vas/rest/index.vhtml b/vas/rest/index.vhtml index 4e0e614d1bd2d65f7ec472036138c5efa867865a..44fcbfafc04970d93a27ba07d5f48bf0eae08435 100755 --- a/vas/rest/index.vhtml +++ b/vas/rest/index.vhtml @@ -1,4 +1,8 @@ <?php - header('Content-type: '.$aValues['output'].'; charset='.$properties["page_encoding"]); + ob_end_flush(); + $aCurrentHeaders = apache_response_headers(); + if(!array_key_exists('Content-Type-Set-By', $aCurrentHeaders)){ + header('Content-type: '.$aValues['output'].'; charset='.$properties["page_encoding"]); + } echo $sMessage; -?> \ No newline at end of file +?> diff --git a/vas/rest/ws/vitis/FileDownloader.class.inc b/vas/rest/ws/vitis/FileDownloader.class.inc index 4f838a8241cceb03b4f6d2b4046e7a03cb4122f1..c2f2e825c66a8686562611730132344501797afa 100755 --- a/vas/rest/ws/vitis/FileDownloader.class.inc +++ b/vas/rest/ws/vitis/FileDownloader.class.inc @@ -128,8 +128,9 @@ class FileDownloader extends Vitis { return array("status" => 1, "fileName" => $sFileName); } - header("Content-Type: " . $sContentType); - if (in_array($sContentType, array("text/plain", 'application/pdf', 'text/html'))){ + header("Content-Type: " . $sContentType .'; charset='. $this->aProperties["page_encoding"]); + header("Content-Type-Set-By: vitis/filedownloader"); + if (in_array($sContentType, array("text/plain", 'application/pdf', 'text/html', 'application/xml', 'application/json'))){ header("Content-disposition: inline; filename=\"" . rawurlencode($sFileName) . "\""); } else { header("Content-disposition: attachment; filename=\"" . rawurlencode($sFileName) . "\"");