Skip to content

Commit

Permalink
Use correct headers for json data
Browse files Browse the repository at this point in the history
It was previously not marked as such what could potentially lead to
browsers doing some autodetection.

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Feb 25, 2016
1 parent e65f375 commit c842a0d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions file_echo.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,16 @@

} else if (isset($_REQUEST['monitorconfig'])) {
/* For monitor chart config export */
PMA_downloadHeader('monitor.cfg', 'application/force-download');
PMA_downloadHeader('monitor.cfg', 'application/json; charset=UTF-8');
header('X-Content-Type-Options: nosniff');

echo urldecode($_REQUEST['monitorconfig']);

} else if (isset($_REQUEST['import'])) {
/* For monitor chart config import */
header('Content-type: text/plain');
header('Content-Type: application/json; charset=UTF-8');
header('X-Content-Type-Options: nosniff');

if (!file_exists($_FILES['file']['tmp_name'])) {
exit();
}
Expand Down

0 comments on commit c842a0d

Please sign in to comment.