summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--controller/pagecontroller.php9
-rw-r--r--tests/unit/controller/PageControllerTest.php2
2 files changed, 9 insertions, 2 deletions
diff --git a/controller/pagecontroller.php b/controller/pagecontroller.php
index f55900a39..ac0384db2 100644
--- a/controller/pagecontroller.php
+++ b/controller/pagecontroller.php
@@ -14,6 +14,7 @@
namespace OCA\News\Controller;
use \OCP\AppFramework\Http\TemplateResponse;
+use \OCP\AppFramework\Http\JSONResponse;
use \OCP\IRequest;
use \OCP\IConfig;
use \OCP\IL10N;
@@ -129,7 +130,7 @@ class PageController extends Controller {
$authors[] = $author['name'];
}
- return [
+ $data = [
"name" => $config['name'],
"type" => 'web',
"default_locale" => $locale,
@@ -142,6 +143,12 @@ class PageController extends Controller {
"url" => $config['homepage']
]
];
+
+ $response = new JSONResponse($data);
+ $response->addHeader('Content-Type',
+ 'application/x-web-app-manifest+json');
+
+ return $response;
}
} \ No newline at end of file
diff --git a/tests/unit/controller/PageControllerTest.php b/tests/unit/controller/PageControllerTest.php
index 48af6860f..0173c3075 100644
--- a/tests/unit/controller/PageControllerTest.php
+++ b/tests/unit/controller/PageControllerTest.php
@@ -156,7 +156,7 @@ class PageControllerTest extends \PHPUnit_Framework_TestCase {
->method('getLanguageCode')
->will($this->returnValue('de_DE'));
- $result = $this->controller->manifest();
+ $result = $this->controller->manifest()->getData();
$this->assertEquals($this->configData['name'], $result['name']);
$this->assertEquals('web', $result['type']);
$this->assertEquals(