Skip to content

Commit

Permalink
fix: use rex_request::requestMethod()
Browse files Browse the repository at this point in the history
  • Loading branch information
eaCe authored Jun 11, 2023
1 parent 6c38495 commit 55d4b69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/RestRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private function validateMethods(): void
*/
public function validateRequestMethod(): void
{
$method = filter_input(INPUT_SERVER, 'REQUEST_METHOD', FILTER_SANITIZE_ENCODED);
$method = strtoupper(rex_request::requestMethod());

if (!in_array($method, $this->methods, true)) {
$this->sendError(sprintf('Method "%s" not allowed!', $method), rex_response::HTTP_FORBIDDEN);
Expand All @@ -89,7 +89,7 @@ public function validateRequestMethod(): void

public function getRequestMethod(): string
{
return filter_input(INPUT_SERVER, 'REQUEST_METHOD', FILTER_SANITIZE_ENCODED);
return rex_request::requestMethod();
}

/**
Expand Down

0 comments on commit 55d4b69

Please sign in to comment.