mirror of
https://github.com/friendica/friendica
synced 2025-04-22 05:10:10 +00:00
Fixing Response
This commit is contained in:
parent
ae24bf8d54
commit
6a9fff5100
11 changed files with 41 additions and 12 deletions
|
@ -199,10 +199,10 @@ class ApiResponse extends Response
|
|||
|
||||
switch ($format) {
|
||||
case 'xml':
|
||||
$this->setHeader('Content-Type: text/xml');
|
||||
$this->setType(static::TYPE_XML);
|
||||
break;
|
||||
case 'json':
|
||||
$this->setHeader('Content-Type: application/json');
|
||||
$this->setType(static::TYPE_JSON);
|
||||
if (!empty($return)) {
|
||||
$json = json_encode(end($return));
|
||||
if (!empty($_GET['callback'])) {
|
||||
|
@ -212,10 +212,10 @@ class ApiResponse extends Response
|
|||
}
|
||||
break;
|
||||
case 'rss':
|
||||
$this->setHeader('Content-Type: application/rss+xml');
|
||||
$this->setType(static::TYPE_RSS);
|
||||
break;
|
||||
case 'atom':
|
||||
$this->setHeader('Content-Type: application/atom+xml');
|
||||
$this->setType(static::TYPE_ATOM);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue