Add OPTIONS endpoint

This commit is contained in:
Philipp 2022-01-02 20:25:32 +01:00
parent 1239ce1e7e
commit 01c1e137f7
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
3 changed files with 35 additions and 8 deletions

View file

@ -173,6 +173,18 @@ abstract class BaseModule implements ICanHandleRequests
{
}
/**
* Module OPTIONS method to process submitted data
*
* Extend this method if the module is supposed to process OPTIONS requests.
* Doesn't display any content
*
* @param string[] $request The $_REQUEST content
*/
protected function options(array $request = [])
{
}
/**
* {@inheritDoc}
*/
@ -225,6 +237,9 @@ abstract class BaseModule implements ICanHandleRequests
case Router::PUT:
$this->put($request);
break;
case Router::OPTIONS:
$this->options($request);
break;
}
$timestamp = microtime(true);