Process a server request and return a response.
513205
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        // TODO : il faudrait peut etre récupérer la réponse via un $handle->handle() pour récupérer les headers de la réponse + le charset et version 1.1/1.0 pour le passer dans les exceptions (notfound+methodnotallowed) car on va recréer une nouvelle response !!!! donc si ca se trouve les headers custom genre X-Powered ou CORS vont être perdus lorsqu'on va afficher les message custom pour l'exception 404 par exemple !!!!

        //$result = $this->getDispatchResult($request);
        $result = $this->router->match($request);

        if ($result->isMethodFailure()) {
            $allowedMethods = $result->getAllowedMethods();
            // The OPTIONS request should send back a response with some headers like "Allow" header.
            // TODO : vérifier le comportement avec CORS.
            if ($request->getMethod() === 'OPTIONS') {
                return ($this->responseFactory->createResponse())->withHeader('Allow', implode(', ', $allowedMethods));
            }

            throw new MethodNotAllowedHttpException($allowedMethods);
        } elseif ($result->isFailure()) {
            // Http error 404 not found
            throw new NotFoundHttpException();
        }

        // add some usefull information about the url used for the routing
        // TODO : faire plutot porter ces informations (method et uri utilisé) directement dans l'objet RouteResult ??????
        //$request = $request->withAttribute('routeInfo', [$request->getMethod(), (string) $request->getUri()]);

        // Store the actual route result in the request attributes.
        $request = $request->withAttribute(RouteResult::class, $result);

        // Execute the next handler
        $response = $handler->handle($request);

        // As per RFC, HEAD request can't have a body.
        if (strtoupper($request->getMethod()) === 'HEAD') {
            // TODO : il faudrait surement enlever le ContentType et le Content-Lenght ? non ????
            $response = $response->withBody($this->streamFactory->createStream());
        }

        return $response;
    }
1052695
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        /* @var \Swoft\Http\Server\Parser\RequestParserInterface $requestParser */
        $requestParser = App::getBean('requestParser');
        $request       = $requestParser->parse($request);

        return $handler->handle($request);
    }
628589
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $isMatching = $this->match($request);

        // add regex matches to the request
        $request->param = new RouteParameter($this->matches);

        if (!$isMatching) {
            return $this->processParent($request, $handler);
        }
        return $this->stack->handle($request);
    }
297246
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $response = $handler->handle($request);
        if ($this->onlyPreflight) {
            if ($this->cors->isPreflightRequest('psr-7', $request)) {
                return $this
                    ->handle($request, $response)
                    ->withStatus(204);
            }

            return $response;
        }

        return $this->handle($request, $response);
    }
8851
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $server = $request->getServerParams();
        $startTime = $server['REQUEST_TIME_FLOAT'] ?? microtime(true);
        $response = $handler->handle($request);

        return $response->withHeader(self::HEADER, sprintf('%2.3fms', (microtime(true) - $startTime) * 1000));
    }
1030120
def process_request(self, request_object):
        """"""

        identifier = request_object.identifier

        # Look for the object by its ID and return it
        resource = request_object.entity_cls.get(identifier)
        return ResponseSuccess(Status.SUCCESS, resource)
803851
def process_response(self, request, response):
        """"""
        if tldap.transaction.is_managed():
            tldap.transaction.commit()
            tldap.transaction.leave_transaction_management()
        return response
42705
public function process(ServerRequestInterface $request, RequestHandlerInterface $next): ResponseInterface
    {
        $response = $next->handle($request);

        if (\count($this->originHosts)) {
            $response = $response->withHeader(self::ORIGIN, implode(' ', $this->originHosts));
        }

        if (\count($this->allowHeaders)) {
            $response = $response->withHeader(self::HEADERS, implode(', ', $this->allowHeaders));
        }

        if (\count($this->allowMethods)) {
            $response = $response->withHeader(self::METHODS, implode(', ', $this->allowMethods));
        }

        return $response;
    }
600901
def process_request(self):
        """"""
        self.response = self.request_handler.process_request(
            self.method, self.request_data)
560317
def process_response(self, request, response):
        """"""

        # never cache headers + ETag
        add_never_cache_headers(response)

        if not hasattr(request, '_cache_update_cache') or not request._cache_update_cache:
            # We don't need to update the cache, just return.
            return response
        if request.method != 'GET':
            # This is a stronger requirement than above. It is needed
            # because of interactions between this middleware and the
            # HTTPMiddleware, which throws the body of a HEAD-request
            # away before this middleware gets a chance to cache it.
            return response
        if not response.status_code == 200:
            return response

        # use the precomputed cache_key
        if request._cache_middleware_key:
            cache_key = request._cache_middleware_key
        else:
            cache_key = learn_cache_key(request, response, self.cache_timeout, self.key_prefix)

        # include the orig_time information within the cache
        cache.set(cache_key, (time.time(), response), self.cache_timeout)
        return response
417646
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $response = $handler->handle($request);

        if (stripos($response->getHeaderLine('Content-Type'), $this->mimetype) === 0) {
            $stream = $this->createStream($this->minify((string) $response->getBody()));

            return $response->withBody($stream)
                ->withoutHeader('Content-Length');
        }

        return $response;
    }
342431
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        if ($this->cors->onlyPreflight()) {
            if ($this->cors->isPreflightRequest('psr-7', $request)) {
                if (!(($response = $this->getResponse()) instanceof ResponseInterface)) {
                    $response = $handler->handle($request);
                }

                return $this
                    ->handle($request, $response)
                    ->withStatus(204);
            }

            return $handler->handle($request);
        }

        return $this->handle($request, $handler->handle($request));
    }
20440
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $errorPageConfig = Config::getInstance()->get('errorPage');
        $controllerClass = '\\app\\Controllers\\' . $errorPageConfig[0];
        $route = new Route('404', $errorPageConfig[0], $errorPageConfig[1]);
        $controller = new $controllerClass($route, $request);
        $response = new Response;
        ob_start();
        $controller->execute();
        $responseController = ob_get_clean();
        $response->getBody()->write($responseController);
        $response = $response->withStatus(404);
        $logger = new Logger();
        $logger->info('Error 404, NotFoundMiddleware');
        return $response;
    }
74158
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $route = $this->routerDispatcher->dispatch($request);
        if (count($route->getAttributes())) {
            foreach ($route->getAttributes() as $key => $value) {
               $request = $request->withAttribute($key, $value);
            }
        }
        $request = $request->withAttribute('route', $route);

        return $handler->handle($request);
    }
87531
public function process(ServerRequestInterface $request,  RequestHandlerInterface $handler) : ResponseInterface
    {
        $body = $this->parseBody($request);
        $parsedBody = $request->getParsedBody();

        $request = $request->withParsedBody(array_merge($body, $parsedBody));

        return $handler->handle($request);
    }
612216
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        RendererFacade::init($this->renderer);
        return $handler->handle($request);
    }
319056
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
	{
		$requestMethod = $request->getMethod();
		$method = $this->getOverrideMethod($requestMethod, $request);

		if (!empty($method) && $method !== $requestMethod) {
			$allowed = $this->getAllowedOverrideMethods($requestMethod);
			if ([] !== $allowed) {
				if (\in_array($method, $allowed, true)) {
					$request = $request->withMethod($method);
				} else {
					return Factory::response(405);
				}
			}
		}

		return $handler->handle($request);
	}