Process a server request and return a response.
771458
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $uri = $request->getUri();
        $language = $this->detectFromPath($uri->getPath());

        if ($language === null) {
            $language = $this->detectFromHeader($request);

            if ($this->redirect && $this->usePath) {
                $location = $uri->withPath(str_replace('//', '/', $language.'/'.$uri->getPath()));

                return $this->createResponse(302)
                    ->withHeader('Location', (string) $location);
            }
        }

        $response = $handler->handle($request->withHeader('Accept-Language', (string) $language));

        if (!$response->hasHeader('Content-Language')) {
            return $response->withHeader('Content-Language', (string) $language);
        }

        return $response;
    }
1056894
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        // Use an array cache for database calls, etc.
        app()->instance('cache.array', new Repository(new ArrayStore()));

        return $handler->handle($request);
    }
1268487
public function process(
        ServerRequestInterface $p_request,
        RequestHandlerInterface $p_handler
    ): ResponseInterface {
        return call_user_func_array([$this->object, $this->function], [$p_request]);
    }
474826
def process_response(self, request, response, resource, req_succeeded):
        """"""
        sid = request.cookies.get(self.cookie_name, None)
        if sid is None or not self.store.exists(sid):
            sid = self.generate_sid()

        self.store.set(sid, request.context.get(self.context_name, {}))
        response.set_cookie(self.cookie_name, sid, expires=self.cookie_expires, max_age=self.cookie_max_age,
                            domain=self.cookie_domain, path=self.cookie_path, secure=self.cookie_secure,
                            http_only=self.cookie_http_only)
1012298
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        try {
            try {
                return $handler->handle($request);
            } catch (HttpException $exception) {
                $original_exception = $exception;

                return $this->httpExceptionResponse($request, $exception);
            } catch (Throwable $exception) {
                $original_exception = $exception;

                return $this->unhandledExceptionResponse($request, $exception);
            }
        } catch (Throwable $exception) {
            // If we can't handle the exception, rethrow it.
            throw $original_exception;
        }
    }
17797
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $response = $handler->handle($request);

        // Run the cleanup after random page requests.
        if ($request->getMethod() === RequestMethodInterface::METHOD_GET && random_int(1, self::PROBABILITY) === 1) {
            $this->runHousekeeping();
        }

        return $response;
    }
282576
public function process(
        ServerRequestInterface $p_request,
        RequestHandlerInterface $p_handler
    ): ResponseInterface {
        $method = $p_request->getMethod();
        if (!in_array($method, $this->ignoreHttpMethods, true)) {
            return $p_handler->handle($p_request);
        }
        return $this->createResponse(405, []);
    }
1154817
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        if (!$this->isValid($request)) {
            return $this->createResponse(403);
        }

        return $handler->handle($request);
    }
104937
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $fn = $this->callable;
        if (!$this->callable instanceof Closure) {
            $return = call_user_func_array($fn, [$request, $handler]);
            if (null === $return) {
                return $handler->handle($request);
            }
            return $return;
        }
        return $fn($request, $handler);
    }
648332
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
    {
        $this->startTransaction();
        $response = $handler->handle($request);
        $this->endTransaction();

        return $response;
    }
1222580
def process_response(self, request, response):
        
        if not self.should_cache(request, response):
            # We don't need to update the cache, just return
            return response 

        response = self.patch_headers(response)
        self.set_cache(request, response)

        return response
1318423
def _process_response(self, request, response):
        """"""
        log_format = self._get_log_format(request)
        if not log_format:
            return response

        params = self._get_parameters_from_request(request)
        # log a message displayed to user
        messages = django_messages.get_messages(request)
        result_message = None
        if messages:
            result_message = ', '.join('%s: %s' % (message.tags, message)
                                       for message in messages)
        elif 'action' in request.POST:
            result_message = request.POST['action']
        params['message'] = result_message
        params['http_status'] = response.status_code

        self.OPERATION_LOG.info(log_format, params)

        return response
60065
def execute(self, request_object):
        """"""

        # If the request object is not valid then return a failure response
        if not request_object.is_valid:
            return ResponseFailure.build_from_invalid_request(
                request_object)

        # Try to process the request and handle any errors encountered
        try:
            return self.process_request(request_object)

        except ValidationError as err:
            return ResponseFailure.build_unprocessable_error(err.normalized_messages)

        except ObjectNotFoundError:
            return ResponseFailure.build_not_found(
                [{'identifier': 'Object with this ID does not exist.'}])

        except Exception as exc:
            logger.error(
                f'{self.__class__.__name__} execution failed due to error {exc}',
                exc_info=True)
            return ResponseFailure.build_system_error([{exc.__class__.__name__: exc}])
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));
    }
572187
def process_response(self, request, response):
        
        if not hasattr(request, 'location'):
            return response

        storage = storage_class(request=request, response=response)
        try:
            storage.set(location=request.location)
        except ValueError:
            # bad location_id
            pass
        return response
296655
def get_response(self, request, *args, **kwargs):
        ''''''
        # normal process
        response = HttpResponseRedirect(self.redirect_to)
        response[REDIRECT_HEADER_KEY] = self.redirect_to
        return response
164532
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $response = $handler->handle($request);

        if (stripos($request->getHeaderLine('Accept-Encoding'), $this->encoding) !== false
            && !$response->hasHeader('Content-Encoding')
        ) {
            $stream = $this->createStream($this->encode((string) $response->getBody()));

            return $response
                ->withHeader('Content-Encoding', $this->encoding)
                ->withoutHeader('Content-Length')
                ->withBody($stream);
        }

        return $response;
    }