diff --git a/includes/Api/ApiFormatManifest.php b/includes/Api/ApiFormatManifest.php new file mode 100644 index 00000000..2d5b07f5 --- /dev/null +++ b/includes/Api/ApiFormatManifest.php @@ -0,0 +1,40 @@ +. + * + * @file + */ + +namespace MediaWiki\Skins\Citizen\Api; + +use ApiFormatJson; + +/** + * T282500 + * TODO: This should be merged to core + */ +class ApiFormatManifest extends ApiFormatJson { + /** + * Return the proper content-type + * + * @return string + */ + public function getMimeType() { + return 'application/manifest+json'; + } +} diff --git a/includes/Api/ApiWebappManifest.php b/includes/Api/ApiWebappManifest.php index d79cc79f..ba53b3b5 100644 --- a/includes/Api/ApiWebappManifest.php +++ b/includes/Api/ApiWebappManifest.php @@ -23,7 +23,7 @@ namespace MediaWiki\Skins\Citizen\Api; use ApiBase; -use ApiFormatJson; +use MediaWiki\Skins\Citizen\Api\ApiFormatManifest; use MediaWiki\MediaWikiServices; use SpecialPage; use Title; @@ -31,6 +31,9 @@ use Title; /** * Based on the MobileFrontend extension * Return the webapp manifest for this wiki + * + * T282500 + * TODO: This should be merged to core */ class ApiWebappManifest extends ApiBase { /** @@ -144,9 +147,9 @@ class ApiWebappManifest extends ApiBase { /** * Get the JSON printer * - * @return ApiFormatJson + * @return ApiFormatManifest */ public function getCustomPrinter() { - return new ApiFormatJson( $this->getMain(), 'json' ); + return new ApiFormatManifest( $this->getMain(), 'json' ); } }