]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Special/Options.php
Merge pull request #12459 from MrPetovan/bug/12454-link-preview-translation
[friendica.git] / src / Module / Special / Options.php
index ecc9e2e0c7762ed126059cb814a5a154e7441246..79ce5d0c2ed9fc75fb8274d5caf34c102e5a9f2c 100644 (file)
@@ -23,6 +23,7 @@ namespace Friendica\Module\Special;
 
 use Friendica\App\Router;
 use Friendica\BaseModule;
+use Friendica\Module\Response;
 
 /**
  * Returns the allowed HTTP methods based on the route information
@@ -33,16 +34,13 @@ use Friendica\BaseModule;
  */
 class Options extends BaseModule
 {
-       protected function options(array $request = [])
+       protected function rawContent(array $request = [])
        {
-               $allowedMethods = $this->parameters['AllowedMethods'] ?? [];
-
-               if (empty($allowedMethods)) {
-                       $allowedMethods = Router::ALLOWED_METHODS;
-               }
+               $allowedMethods = $this->parameters['AllowedMethods'] ?? Router::ALLOWED_METHODS;
 
                // @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS
                $this->response->setHeader(implode(',', $allowedMethods), 'Allow');
                $this->response->setStatus(204);
+               $this->response->setType(Response::TYPE_BLANK);
        }
 }