summaryrefslogtreecommitdiffstats
path: root/ocs/v1.php
diff options
context:
space:
mode:
Diffstat (limited to 'ocs/v1.php')
-rw-r--r--ocs/v1.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/ocs/v1.php b/ocs/v1.php
index 1652b0bedbe..af83a56ff14 100644
--- a/ocs/v1.php
+++ b/ocs/v1.php
@@ -21,6 +21,15 @@
*
*/
-require_once '../lib/base.php';
-@ob_clean();
-OC_OCS::handle();
+require_once('../lib/base.php');
+use Symfony\Component\Routing\Exception\ResourceNotFoundException;
+use Symfony\Component\Routing\Exception\MethodNotAllowedException;
+
+try {
+ OC::getRouter()->match('/ocs'.$_SERVER['PATH_INFO']);
+} catch (ResourceNotFoundException $e) {
+ OC_OCS::notFound();
+} catch (MethodNotAllowedException $e) {
+ OC_Response::setStatus(405);
+}
+