From 006b127da44b8cf0771000ed6fbf2228dfe734f6 Mon Sep 17 00:00:00 2001 From: Bart Visscher <bartv@thisnet.nl> Date: Tue, 31 Jul 2012 22:33:53 +0200 Subject: [PATCH] Routing: Handle MethodNotAllowedException --- ocs/v1.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ocs/v1.php b/ocs/v1.php index 4580221e60..7cd61035e7 100644 --- a/ocs/v1.php +++ b/ocs/v1.php @@ -23,6 +23,7 @@ require_once('../lib/base.php'); use Symfony\Component\Routing\Exception\ResourceNotFoundException; +use Symfony\Component\Routing\Exception\MethodNotAllowedException; OC::$router->useCollection('ocs'); OC::$router->loadRoutes(); @@ -31,4 +32,6 @@ try { OC::$router->match($_SERVER['PATH_INFO']); } catch (ResourceNotFoundException $e) { OC_OCS::notFound(); +} catch (MethodNotAllowedException $e) { + OC_Response::setStatus(405); } -- GitLab