Skip to content

Commit c842a0d

Browse files
committed
Use correct headers for json data
It was previously not marked as such what could potentially lead to browsers doing some autodetection. Signed-off-by: Michal Čihař <michal@cihar.com>
1 parent e65f375 commit c842a0d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: file_echo.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,16 @@
6767

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

7375
} else if (isset($_REQUEST['import'])) {
7476
/* For monitor chart config import */
75-
header('Content-type: text/plain');
77+
header('Content-Type: application/json; charset=UTF-8');
78+
header('X-Content-Type-Options: nosniff');
79+
7680
if (!file_exists($_FILES['file']['tmp_name'])) {
7781
exit();
7882
}

0 commit comments

Comments
 (0)