mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
JsonResponse: Set content type at initialization and not at sendHeaders
refs #12161
This commit is contained in:
parent
c3276d4341
commit
703561f874
@ -67,6 +67,13 @@ class JsonResponse extends Response
|
|||||||
*/
|
*/
|
||||||
protected $successData;
|
protected $successData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Content type of this response
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $contentType = 'application/json';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the JSON encoding options
|
* Get the JSON encoding options
|
||||||
*
|
*
|
||||||
@ -186,15 +193,6 @@ class JsonResponse extends Response
|
|||||||
echo json_encode($body, $this->getEncodingOptions());
|
echo json_encode($body, $this->getEncodingOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function sendHeaders()
|
|
||||||
{
|
|
||||||
$this->setContentType('application/json');
|
|
||||||
parent::sendHeaders();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user