diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-07-21 19:52:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-21 19:52:17 +0200 |
commit | 562e63cf69fd56aea51bf9e1e591f4eeb5c395c5 (patch) | |
tree | 61441d402dce9caafa71f6b15ee2a1b270ec7f0f /lib/public/AppFramework/Controller.php | |
parent | 8ec019e10594857a018d3f9298659a5757930fbf (diff) | |
parent | e42f2f26504e3fcf975c15c3d3732646e819f37e (diff) | |
download | nextcloud-server-562e63cf69fd56aea51bf9e1e591f4eeb5c395c5.tar.gz nextcloud-server-562e63cf69fd56aea51bf9e1e591f4eeb5c395c5.zip |
Merge pull request #480 from nextcloud/fix_ocs_response_format
AppFramework default response for OCS is xml
Diffstat (limited to 'lib/public/AppFramework/Controller.php')
-rw-r--r-- | lib/public/AppFramework/Controller.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/public/AppFramework/Controller.php b/lib/public/AppFramework/Controller.php index daf6018cd12..c6baa5e30c1 100644 --- a/lib/public/AppFramework/Controller.php +++ b/lib/public/AppFramework/Controller.php @@ -104,8 +104,9 @@ abstract class Controller { * @param string $acceptHeader * @return string the responder type * @since 7.0.0 + * @since 9.1.0 Added default parameter */ - public function getResponderByHTTPHeader($acceptHeader) { + public function getResponderByHTTPHeader($acceptHeader, $default='json') { $headers = explode(',', $acceptHeader); // return the first matching responder @@ -119,8 +120,8 @@ abstract class Controller { } } - // no matching header defaults to json - return 'json'; + // no matching header return default + return $default; } |