Issue #341588 by voxpelli, mikl, Albert Volkman, dawehner: use the right JSON MIME...
authorGábor Hojtsy
Fri, 27 Apr 2012 13:28:14 +0000 (15:28 +0200)
committerGábor Hojtsy
Fri, 27 Apr 2012 13:28:14 +0000 (15:28 +0200)
includes/common.inc

index 4848f8e..b36805f 100644 (file)
@@ -2572,8 +2572,8 @@ function drupal_to_js($var) {
  *   (optional) If set, the variable will be converted to JSON and output.
  */
 function drupal_json($var = NULL) {
-  // We are returning JavaScript, so tell the browser.
-  drupal_set_header('Content-Type: text/javascript; charset=utf-8');
+  // We are returning JSON, so tell the browser.
+  drupal_set_header('Content-Type: application/json');
 
   if (isset($var)) {
     echo drupal_to_js($var);