]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Special/Options.php
Security: Use htmlspecialchars() for user input in Arguments class
[friendica.git] / src / Module / Special / Options.php
index ecc9e2e0c7762ed126059cb814a5a154e7441246..26a21f0482837748908b63487561a770ee4d61d8 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -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);
        }
 }