Commit d214b178 authored by Michael Kessler's avatar Michael Kessler
Browse files

Revert "[BUGFIX] Don't change action name on requests"

This reverts commit 3fb8ab4d.
parent 8962e4ea
......@@ -156,12 +156,20 @@ abstract class AbstractRestMiddleware implements LoggerAwareInterface, Middlewar
}
/**
* Method returns the requested action for the rest controller.
* Method returns the requested action for the rest controller. If no
*
* @param $method
* @return string
*/
protected function getActionName(): string {
return $this->pathSegments['verb'];
protected function getCallableActionName($method): string {
if ($method === 'POST') {
return 'post' . mb_strtoupper(mb_substr($this->pathSegments['verb'], 0, 1)) . mb_substr(
$this->pathSegments['verb'], 1
);
}
return 'get' . mb_strtoupper(mb_substr($this->pathSegments['verb'], 0, 1)) . mb_substr(
$this->pathSegments['verb'], 1
);
}
/**
......
......@@ -96,7 +96,7 @@ class RestAuthenticator extends AbstractRestMiddleware {
$className = $this->getClassName();
$httpMethod = $request->getMethod();
$actionName = $this->getActionName();
$actionName = $this->getCallableActionName($httpMethod);
/**
* when the client requests a bearer token, we don't need to do access checks etc. the user verification is done by the AuthServices
......
......@@ -94,7 +94,7 @@ class RestDispatcher extends AbstractRestMiddleware {
$className = $this->getClassName();
$httpMethod = $request->getMethod();
$actionName = $this->getActionName();
$actionName = $this->getCallableActionName($httpMethod);
/** @var DataResolveService $dataResolveService */
$dataResolveService = GeneralUtility::makeInstance(DataResolveService::class);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment