From: Alexander Ebert Date: Mon, 11 Mar 2024 15:31:22 +0000 (+0100) Subject: Add support for `DELETE` requests X-Git-Tag: 6.1.0_Alpha_1~148^2~14 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7a79dc0ca6ab11f0424b0526fd80720cf9c7bbb1;p=GitHub%2FWoltLab%2FWCF.git Add support for `DELETE` requests --- diff --git a/wcfsetup/install/files/lib/action/ApiAction.class.php b/wcfsetup/install/files/lib/action/ApiAction.class.php index baf138b58d..6721ade812 100644 --- a/wcfsetup/install/files/lib/action/ApiAction.class.php +++ b/wcfsetup/install/files/lib/action/ApiAction.class.php @@ -10,6 +10,7 @@ use Laminas\Diactoros\Response\JsonResponse; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Server\RequestHandlerInterface; +use wcf\http\attribute\AllowHttpMethod; use wcf\system\endpoint\event\ControllerCollecting; use wcf\system\endpoint\IController; use wcf\system\endpoint\RequestFailure; @@ -21,6 +22,7 @@ use wcf\system\request\RouteHandler; use function FastRoute\simpleDispatcher; +#[AllowHttpMethod('DELETE')] final class ApiAction implements RequestHandlerInterface { #[\Override] diff --git a/wcfsetup/install/files/lib/system/endpoint/DeleteRequest.class.php b/wcfsetup/install/files/lib/system/endpoint/DeleteRequest.class.php new file mode 100644 index 0000000000..6b43821461 --- /dev/null +++ b/wcfsetup/install/files/lib/system/endpoint/DeleteRequest.class.php @@ -0,0 +1,12 @@ + 'DELETE', self::GET => 'GET', self::POST => 'POST', };