Routing: Handle MethodNotAllowedException
This commit is contained in:
parent
9d6a09f589
commit
006b127da4
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue