|
11 | 11 | * @author Thomas Müller <thomas.mueller@tmit.eu> |
12 | 12 | * @author Tom Needham <tom@owncloud.com> |
13 | 13 | * @author Vincent Petry <pvince81@owncloud.com> |
| 14 | + * @author Semih Serhat Karakaya <karakayasemi@itu.edu.tr> |
14 | 15 | * |
15 | 16 | * @copyright Copyright (c) 2017, ownCloud GmbH |
16 | 17 | * @license AGPL-3.0 |
|
34 | 35 | use OC\User\LoginException; |
35 | 36 | use Symfony\Component\Routing\Exception\ResourceNotFoundException; |
36 | 37 | use Symfony\Component\Routing\Exception\MethodNotAllowedException; |
| 38 | +use OCP\Http\HttpEvents; |
37 | 39 |
|
38 | 40 | require_once __DIR__ . '/../lib/base.php'; |
39 | 41 |
|
|
63 | 65 | OC::$server->getRouter()->match('/ocs'.\OC::$server->getRequest()->getRawPathInfo()); |
64 | 66 | return; |
65 | 67 | } catch (ResourceNotFoundException $e) { |
| 68 | + $dispatcher = \OC::$server->getEventDispatcher(); |
| 69 | + $dispatcher->dispatch(\OCP\Http\HttpEvents::EVENT_404, new OCP\Http\HttpEvents( |
| 70 | + \OCP\Http\HttpEvents::EVENT_404, |
| 71 | + OC::$server->getRequest() |
| 72 | + )); |
66 | 73 | // Fall through the not found |
67 | 74 | } catch (MethodNotAllowedException $e) { |
68 | 75 | OC_API::setContentType(); |
|
85 | 92 | } catch (LoginException $e) { |
86 | 93 | OC_API::respond(new Result(null, \OCP\API::RESPOND_UNAUTHORISED, 'Unauthorised'), OC_API::requestedFormat()); |
87 | 94 | } catch (ResourceNotFoundException $e) { |
| 95 | + $dispatcher = \OC::$server->getEventDispatcher(); |
| 96 | + $dispatcher->dispatch(\OCP\Http\HttpEvents::EVENT_404, new OCP\Http\HttpEvents( |
| 97 | + \OCP\Http\HttpEvents::EVENT_404, |
| 98 | + OC::$server->getRequest() |
| 99 | + )); |
88 | 100 | OC_API::setContentType(); |
89 | 101 | OC_API::notFound(); |
90 | 102 | } catch (MethodNotAllowedException $e) { |
|
0 commit comments