use Friendica\App\Router;
use Friendica\BaseModule;
+use Friendica\Module\Response;
/**
* Returns the allowed HTTP methods based on the route information
*/
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);
}
}