@param ServerRequestInterface $request

@return bool
769794
protected function isSupportContentType(ServerRequestInterface $request): bool
    {
        $contentType = $request->getHeaderLine('content-type');

        foreach ($this->allowContentTypes as $allowContentType) {
            if (stripos($contentType, $allowContentType) === 0) {
                return true;
            }
        }

        return false;
    }
281740
private function onRequest(ServerRequestInterface $request)
    {
        $start = microtime(true);
        $psrResponse = $this->requestHandler->dispatch($request);
        $this->logger->debug('Processing took ' . number_format((microtime(true) - $start) * 1000, 3) . ' milliseconds');

        return $psrResponse;
    }
1068465
public function handle(ServerRequestInterface $request): ResponseInterface
    {
        $body = $request->getParsedBody();

        $method = strtoupper($body[self::METHOD_INPUT_KEY] ?? $request->getMethod());

        $request = $request->withMethod($method);

        $this->match = $this->adapter->match($request);

        return $this->match->handle($request);
    }
548247
private function detectCharset(ServerRequestInterface $request)
    {
        $accept = $request->getHeaderLine('Accept-Charset');

        return $this->negotiateHeader($accept, new CharsetNegotiator(), $this->charsets);
    }
437156
public function matchRequest(ServerRequest $request)
    {
        return $this->getMatchRoute(
            $request->getMethod(),
            $this->getUrl($request)
        );
    }
1065021
protected function matchRoute(ServerRequestInterface $request): ?RouteInterface
    {
        foreach ($this->routes as $route) {
            // Matched route will return new route instance with matched parameters
            $matched = $route->match($request);

            if (!empty($matched)) {
                return $matched;
            }
        }

        if (!empty($this->default)) {
            return $this->default->match($request);
        }

        // unable to match any route
        return null;
    }
913908
public function match(
       ServerRequestInterface &$request,
       RouteInterface $route): bool
   {
        if ($this->matchAction($request, $route)
         && $this->matchPath($request, $route)) {
            $request = $request->withAttribute("route", $route);
            return true;
        }
        return false;
   }
1070048
public function authorize(ServerRequest $request)
    {
        if (isset($GLOBALS[ 'account' ][ 'role' ])) {
            $uriSegments = $request->getUri()->getSegments()->getString();
            $role = $GLOBALS[ 'account' ][ 'role' ];
            if (in_array($role->code, ['DEVELOPER', 'ADMINISTRATOR'])) {
                globals()->store('authority', new Authority([
                    'permission' => 'GRANTED',
                    'privileges' => '11111111',
                ]));

                return true;
            } elseif ($role->authorities instanceof Authorities) {
                if ($role->authorities->exists($uriSegments)) {
                    $authority = $role->authorities->getAuthority($uriSegments);

                    globals()->store('authority', $authority);

                    return $authority->getPermission();
                }

                globals()->store('authority', new Authority([
                    'permission' => 'DENIED',
                    'privileges' => '00000000',
                ]));

                return false;
            }
        }

        return false;
    }
508000
public function findByRequest(ServerRequestInterface $request)
    {
        $result = $this->findRouteByRequest($request, trim($request->getUri()->getPath(), '/'));

        if(!$result['route'])
            throw new RouteNotFoundException('Route for request '.$request->getMethod().' '.$request->getUri()->getPath().' does not exist');

        return $this->factory->createFinding($result['route'], $result['parameter'], $request);
    }
1109249
public function edit(ServerRequestInterface $request)
    {
        if ($this->isReadOnly()) {
            return new NotFoundStatusResponse();
        }

        if ($this->active_object && $this->active_object->isLoaded()) {
            $authenticated_user = $this->getAuthenticatedUser($request);

            if ($this->shouldCheckPermissions() && !$this->canEdit($this->active_object, $authenticated_user)) {
                return new ForbiddenStatusResponse();
            }

            $request_body = $request->getParsedBody();

            if (empty($request_body)) {
                $request_body = [];
            }

            if ($this->requestBodyContainsProtectedFields($this->active_object, $request_body)) {
                return new BadRequestStatusResponse();
            }

            $this->cleanUpRequestBodyForEdit($request_body, $authenticated_user);

            try {
                return $this->pool->modify($this->active_object, $request_body);
            } catch (ValidationException $e) {
                return $e;
            }
        } else {
            return new NotFoundStatusResponse();
        }
    }
624894
public function handle(ServerRequestInterface $request): ResponseInterface
    {
        $input = $this->input($request);

        $payload = $this->domain->payload($input);

        return $this->responder->response($request, $payload);
    }
75289
protected function isAllowed(ServerRequestInterface $request, string $role): bool
    {
        $route = $request->getAttribute('route');
        // Get config string like 'routes./home.second.rbac.anonymous' to get rbac config for route with name "second" in route group "home"
        $config = 'routes.'.$route->getGroups()[0]->getPattern().'.'.\strtr('/'.$route->getName(), [$route->getGroups()[0]->getPattern() => '', '-' => '']).'.rbac.'.$role;
        if (\in_array($request->getMethod(), $this->config($config, []), true)) {
            return true;
        }

        return false;
    }
132479
private function isValid(ServerRequestInterface $request): bool
    {
        $method = strtoupper($request->getMethod());

        if (in_array($method, ['GET', 'HEAD', 'CONNECT', 'TRACE', 'OPTIONS'], true)) {
            return true;
        }

        $data = $request->getParsedBody();

        return isset($data[$this->name]) && $data[$this->name] === '';
    }
1093232
protected static function checkServerPort(Request $request): bool
    {
        return $request->server->has('SERVER_PORT') && self::HTTPS === (int)$request->server->get('SERVER_PORT');
    }
869011
public function matchRequest(\TYPO3\Flow\Mvc\RequestInterface $request) {
		/** @var \TYPO3\Flow\Security\RequestPatternInterface $pattern */
		foreach ($this->subPatterns as $pattern) {
			if ($pattern->matchRequest($request) === FALSE) {
				return FALSE;
			}
		}

		return TRUE;
	}
744087
public function modify(ServerRequestInterface $request) : ServerRequestInterface
    {
        /** @var ServerRequestModifierInterface $modifier */
        foreach ($this->collection as $modifier) {
            $request = $modifier->modify($request);
        }

        return $request;
    }
824778
public function delete(ServerRequestInterface $request)
    {
        if ($this->isReadOnly()) {
            return new NotFoundStatusResponse();
        }

        if ($this->active_object && $this->active_object->isLoaded()) {
            $authenticated_user = $this->getAuthenticatedUser($request);

            if ($this->shouldCheckPermissions() && !$this->canDelete($this->active_object, $authenticated_user)) {
                return new ForbiddenStatusResponse();
            }

            $this->active_object = $this->pool->scrap($this->active_object);

            if ($this->active_object->isNew()) {
                return [
                    'single' => ['id' => $this->active_object->getId()],
                ];
            } else {
                return $this->active_object;
            }
        } else {
            return new NotFoundStatusResponse();
        }
    }