
<!-- saved from url=(0042)http://drupal.org/files/patch-1219484.diff -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">diff --git a/sites/all/modules/boost/boost.module b/sites/all/modules/boost/boost.module
index 2084503..b3b0f96 100644
--- a/sites/all/modules/boost/boost.module
+++ b/sites/all/modules/boost/boost.module
@@ -768,7 +768,7 @@ function boost_exit($destination = NULL) {
               || stristr($types, 'application/rss+xml')
               || stristr($types, 'application/xml')
                 ) {
-        $extension = BOOST_JSON_EXTENSION;
+        $extension = BOOST_XML_EXTENSION;
       }
       elseif (stristr($types, 'text/html') &amp;&amp; BOOST_CACHE_HTML) {
         $extension = BOOST_FILE_EXTENSION;
@@ -2590,13 +2590,17 @@ function _boost_ob_handler() {
 
     // Check for corret types and cache accordingly
     $types = array_pop($types);
-    if (stristr($types, 'text/javascript') &amp;&amp; BOOST_CACHE_JSON) {
+    if ((stristr($types, 'application/json') 
+      || stristr($types, 'text/javascript')) &amp;&amp; BOOST_CACHE_JSON) {
       if (BOOST_ASYNCHRONOUS_OUTPUT &amp;&amp; !headers_sent()) {
         boost_async_opp($buffer, FALSE, 'text/javascript; charset=utf-8');
       }
       boost_cache_set($GLOBALS['_boost_path'], $decompressed_buffer, BOOST_JSON_EXTENSION);
     }
-    elseif ((stristr($types, 'application/rss') || stristr($types, 'text/xml') || stristr($types, 'application/rss+xml')) &amp;&amp; BOOST_CACHE_XML) {
+    elseif ((stristr($types, 'application/rss') 
+      || stristr($types, 'text/xml') 
+      || stristr($types, 'application/rss+xml') 
+      || stristr($types, 'application/xml')) &amp;&amp; BOOST_CACHE_XML) {
       if (BOOST_ASYNCHRONOUS_OUTPUT &amp;&amp; !headers_sent()) {
         boost_async_opp($buffer, FALSE, 'text/xml; charset=utf-8');
       }
@@ -3808,13 +3812,7 @@ function boost_cache_set($path, $data, $extension = BOOST_FILE_EXTENSION) {
       break;
     case BOOST_JSON_EXTENSION:
       $expire = ($expire == -2) ? BOOST_CACHE_JSON_LIFETIME : $expire;
-      if (variable_get('boost_apache_xheader', 0) &lt; 2) {
-        $comment_start = '/* ';
-        $comment_end = " */\n";
-        $expires_at = date('Y-m-d H:i:s', BOOST_TIME + $expire);
-        $comment = $comment_start . str_replace(array('%cached_at', '%expires_at'), array($cached_at, $expires_at), BOOST_BANNER) . $comment_end;
-        $data = rtrim($data) . "\n" . $comment;
-      }
+      $data = rtrim($data); //unfortunately there is no standards-complian way to insert a comment into JSON without rebuilding the output
       break;
   }
 
</pre></body></html>