[Fusionforge-commits] r13812 - trunk/src/plugins/oslc/include/oslc-zend/application/controllers

Sabri LABBENE labbenes at fusionforge.org
Mon Jul 18 16:49:03 CEST 2011


Author: labbenes
Date: 2011-07-18 16:49:03 +0200 (Mon, 18 Jul 2011)
New Revision: 13812

Modified:
   trunk/src/plugins/oslc/include/oslc-zend/application/controllers/CmController.php
Log:
Negociate mime type on content-type header for put and post http requests.

Modified: trunk/src/plugins/oslc/include/oslc-zend/application/controllers/CmController.php
===================================================================
--- trunk/src/plugins/oslc/include/oslc-zend/application/controllers/CmController.php	2011-07-18 13:04:18 UTC (rev 13811)
+++ trunk/src/plugins/oslc/include/oslc-zend/application/controllers/CmController.php	2011-07-18 14:49:03 UTC (rev 13812)
@@ -167,11 +167,15 @@
 	  $req = $this->getRequest();
 	  //		$action = $req->getActionName();
 	  //	  print_r("Action : ".$action);
+	  
+	  if($action == 'put'  || $action == 'post') {
+		$accept = $req->getHeader('Content-Type');
+	  } else {
+	  	// check Accept header's mime type
+	  	$accept = $req->getHeader('Accept');
+	  	//print_r("\nAccept : ".$accept);
+	  }
 
-	  // check Accept header's mime type
-	  $accept = $req->getHeader('Accept');
-	  //print_r("\nAccept : ".$accept);
-
 	  // prepare an array of accepted types
 	  $accepted_types = array();
 	  if(isset($mime_types[$action])) {




More information about the Fusionforge-commits mailing list