]> git.mxchange.org Git - friendica.git/blobdiff - src/App/Module.php
Merge pull request #10961 from annando/deprecated
[friendica.git] / src / App / Module.php
index ce7cc98f06f7b734bcd46502af2da9e076de7049..5b7c3d15007bb11c995ae001f43027d87c1de708 100644 (file)
@@ -24,11 +24,13 @@ namespace Friendica\App;
 use Friendica\App;
 use Friendica\BaseModule;
 use Friendica\Core;
+use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\LegacyModule;
 use Friendica\Module\Home;
 use Friendica\Module\HTTPException\MethodNotAllowed;
 use Friendica\Module\HTTPException\PageNotFound;
 use Friendica\Network\HTTPException\MethodNotAllowedException;
+use Friendica\Network\HTTPException\NoContentException;
 use Friendica\Network\HTTPException\NotFoundException;
 use Friendica\Util\Profiler;
 use Psr\Log\LoggerInterface;
@@ -170,13 +172,13 @@ class Module
         *
         * @param Arguments                                             $args   The Friendica execution arguments
         * @param Router                                                $router The Friendica routing instance
-        * @param \Friendica\Core\Config\Capability\IManageConfigValues $config The Friendica Configuration
+        * @param IManageConfigValues $config The Friendica Configuration
         *
         * @return Module The determined module of this call
         *
         * @throws \Exception
         */
-       public function determineClass(Arguments $args, Router $router, Core\Config\Capability\IManageConfigValues $config)
+       public function determineClass(Arguments $args, Router $router, IManageConfigValues $config)
        {
                $printNotAllowedAddon = false;
 
@@ -291,9 +293,8 @@ class Module
                // @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS
                // @todo Check allowed methods per requested path
                if ($server['REQUEST_METHOD'] === Router::OPTIONS) {
-                       header('HTTP/1.1 204 No Content');
                        header('Allow: ' . implode(',', Router::ALLOWED_METHODS));
-                       exit();
+                       throw new NoContentException();
                }
 
                $placeholder = '';