summaryrefslogtreecommitdiffstats
path: root/lib/ocs.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-08-11 00:04:43 +0200
committerBart Visscher <bartv@thisnet.nl>2012-08-11 00:04:43 +0200
commit87d1cdb94567d5514e0a2988f69935d932b58ff6 (patch)
tree8dd51c1d5baedcfdc897d47aca678b9b0a1c69ae /lib/ocs.php
parentf63b9b44d8ac62a136d4cd6844e72af7a8044703 (diff)
downloadnextcloud-server-87d1cdb94567d5514e0a2988f69935d932b58ff6.tar.gz
nextcloud-server-87d1cdb94567d5514e0a2988f69935d932b58ff6.zip
Fix for running doing routing in lib/ocs.php
Diffstat (limited to 'lib/ocs.php')
-rw-r--r--lib/ocs.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ocs.php b/lib/ocs.php
index d7a7951fab5..1df08df9fa1 100644
--- a/lib/ocs.php
+++ b/lib/ocs.php
@@ -23,6 +23,9 @@
*
*/
+use Symfony\Component\Routing\Exception\ResourceNotFoundException;
+use Symfony\Component\Routing\Exception\MethodNotAllowedException;
+
/**
* Class to handle open collaboration services API requests
*
@@ -93,7 +96,7 @@ class OC_OCS {
$format = self::readData($method, 'format', 'text', '');
$router = new OC_Router();
- $router->useCollection('ocs');
+ $router->useCollection('root');
// CONFIG
$router->create('config', '/config.{format}')
->defaults(array('format' => $format))
@@ -247,6 +250,8 @@ class OC_OCS {
$txt='Invalid query, please check the syntax. API specifications are here: http://www.freedesktop.org/wiki/Specifications/open-collaboration-services. DEBUG OUTPUT:'."\n";
$txt.=OC_OCS::getdebugoutput();
echo(OC_OCS::generatexml($format,'failed',999,$txt));
+ } catch (MethodNotAllowedException $e) {
+ OC_Response::setStatus(405);
}
exit();
}