mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 12:33:26 +00:00
Workaround for HttpKernel bug in API
This commit is contained in:
33
lib/classes/API/V1/Response.class.php
Normal file
33
lib/classes/API/V1/Response.class.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2012 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* Used as a temporary fix for https://github.com/fabpot/Silex/issues/438
|
||||
*
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
class API_V1_Response extends Response
|
||||
{
|
||||
private $originalStatusCode;
|
||||
|
||||
public function setOriginalStatusCode($code)
|
||||
{
|
||||
$this->originalStatusCode = $code;
|
||||
}
|
||||
|
||||
public function getOriginalStatusCode()
|
||||
{
|
||||
return $this->originalStatusCode;
|
||||
}
|
||||
}
|
@@ -358,12 +358,12 @@ class API_V1_result
|
||||
*/
|
||||
public function get_response()
|
||||
{
|
||||
$response = new Symfony\Component\HttpFoundation\Response(
|
||||
$response = new \API_V1_Response(
|
||||
$this->format()
|
||||
, $this->get_http_code()
|
||||
, array('Content-Type' => $this->get_content_type())
|
||||
);
|
||||
|
||||
$response->setOriginalStatusCode($this->get_http_code());
|
||||
$response->setCharset('UTF-8');
|
||||
|
||||
return $response;
|
||||
|
Reference in New Issue
Block a user