mirror of
https://github.com/friendica/friendica
synced 2025-04-22 02:30:11 +00:00
Add OPTIONS endpoint
This commit is contained in:
parent
1239ce1e7e
commit
01c1e137f7
3 changed files with 35 additions and 8 deletions
16
src/Module/Special/Options.php
Normal file
16
src/Module/Special/Options.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Module\Special;
|
||||
|
||||
use Friendica\App\Router;
|
||||
use Friendica\BaseModule;
|
||||
|
||||
class Options extends BaseModule
|
||||
{
|
||||
protected function options(array $request = [])
|
||||
{
|
||||
// @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS
|
||||
$this->response->setHeader('Allow', implode(',', Router::ALLOWED_METHODS));
|
||||
$this->response->setHeader(($this->server['SERVER_PROTOCOL'] ?? 'HTTP/1.1') . ' 204 No Content');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue