Author: chabotc
Date: Thu Dec 11 04:00:50 2008
New Revision: 725666

URL: http://svn.apache.org/viewvc?rev=725666&view=rev
Log:
Doh, set content-type headers if debug is false, not if it's true..

Modified:
    incubator/shindig/trunk/php/src/social/servlet/DataServiceServlet.php

Modified: incubator/shindig/trunk/php/src/social/servlet/DataServiceServlet.php
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social/servlet/DataServiceServlet.php?rev=725666&r1=725665&r2=725666&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social/servlet/DataServiceServlet.php 
(original)
+++ incubator/shindig/trunk/php/src/social/servlet/DataServiceServlet.php Thu 
Dec 11 04:00:50 2008
@@ -136,13 +136,13 @@
     $outputFormat = strtolower(trim(! empty($_POST[self::$FORMAT_PARAM]) ? 
$_POST[self::$FORMAT_PARAM] : (! empty($_GET[self::$FORMAT_PARAM]) ? 
$_GET[self::$FORMAT_PARAM] : 'json')));
     switch ($outputFormat) {
       case 'xml':
-        if (Config::get('debug')) $this->setContentType('application/xml');
+        if (!Config::get('debug')) $this->setContentType('application/xml');
         return new OutputXmlConverter();
       case 'atom':
-        if (Config::get('debug')) 
$this->setContentType('application/atom+xml');
+        if (!Config::get('debug')) 
$this->setContentType('application/atom+xml');
         return new OutputAtomConverter();
       case 'json':
-        if (Config::get('debug')) $this->setContentType('application/json');
+        if (!Config::get('debug')) $this->setContentType('application/json');
         return new OutputJsonConverter();
       default:
         // if no output format is set, see if we can match an input format 
header
@@ -150,14 +150,14 @@
         if (isset($_SERVER['CONTENT_TYPE'])) {
           switch ($_SERVER['CONTENT_TYPE']) {
             case 'application/atom+xml':
-              if (Config::get('debug')) 
$this->setContentType('application/atom+xml');
+              if (!Config::get('debug')) 
$this->setContentType('application/atom+xml');
               return new OutputAtomConverter();
             case 'application/xml':
-              if (Config::get('debug')) 
$this->setContentType('application/xml');
+              if (!Config::get('debug')) 
$this->setContentType('application/xml');
               return new OutputXmlConverter();
             default:
             case 'application/json':
-              if (Config::get('debug')) 
$this->setContentType('application/json');
+              if (!Config::get('debug')) 
$this->setContentType('application/json');
               return new OutputJsonConverter();
           }
         }


Reply via email to