summaryrefslogtreecommitdiffstats
path: root/ocs/v1.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-10-31 12:12:03 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2020-10-31 12:12:03 +0100
commit3831d8f57f04955cf781eb91a938c92be996a165 (patch)
tree70ffcf7d4ce41be211003eaad1c85bd351ab01a0 /ocs/v1.php
parent5396e98d2d9499f14a1c5abeb71e904642f90c26 (diff)
downloadnextcloud-server-3831d8f57f04955cf781eb91a938c92be996a165.tar.gz
nextcloud-server-3831d8f57f04955cf781eb91a938c92be996a165.zip
Remove the matching on ancient /ocs routes
The appframework has been the default for quite some time now. So time to take proper advantage of it. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'ocs/v1.php')
-rw-r--r--ocs/v1.php37
1 files changed, 5 insertions, 32 deletions
diff --git a/ocs/v1.php b/ocs/v1.php
index b6dfb91d68a..f4ddc80804a 100644
--- a/ocs/v1.php
+++ b/ocs/v1.php
@@ -46,45 +46,18 @@ use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
/*
- * Try old routes first
- * We first try the old routes since the appframework triggers more login stuff.
+ * Try the appframework routes
*/
try {
OC_App::loadApps(['session']);
OC_App::loadApps(['authentication']);
- // load all apps to get all api routes properly setup
- OC_App::loadApps();
-
- OC::$server->getRouter()->match('/ocs'.\OC::$server->getRequest()->getRawPathInfo());
-
- sleep(1);
- OC::$server->getLogger()->info('This uses an old OCP\API::register construct. This will be removed in a future version of Nextcloud. Please migrate to the OCSController');
-
- return;
-} catch (ResourceNotFoundException $e) {
- // Fall through the not found
-} catch (MethodNotAllowedException $e) {
- OC_API::setContentType();
- http_response_code(405);
- exit();
-} catch (\OC\OCS\Exception $ex) {
- OC_API::respond($ex->getResult(), OC_API::requestedFormat());
- exit();
-} catch (Throwable $ex) {
- OC::$server->getLogger()->logException($ex);
-
- OC_API::setContentType();
- http_response_code(500);
- exit();
-}
-
-/*
- * Try the appframework routes
- */
-try {
if (!\OC::$server->getUserSession()->isLoggedIn()) {
OC::handleLogin(\OC::$server->getRequest());
}
+
+ // load all apps to get all api routes properly setup
+ OC_App::loadApps();
+
OC::$server->getRouter()->match('/ocsapp'.\OC::$server->getRequest()->getRawPathInfo());
} catch (ResourceNotFoundException $e) {
OC_API::setContentType();