Handles the client's request

@Route("/")
@return \Symfony\Component\HttpFoundation\Response the response
762297
public function entryPointAction()
    {
        $this->container->get('session')->save();
        $this->logger = $this->container->get('logger');
        /** @var Request $request */
        $request = $this->get('request');
        /** @var Signer $signer */
        $signer = $this->get('signer');
        $proxy_query = ProxyQuery::createFromRequest($request);
        try {
            $signer->checkSignedUrl($proxy_query->getGetUrl());
        } catch (HttpException $e) {
            // let http exceptions run through unmodified
            throw $e;
        } catch (BadSignatureException $e) {
            throw new HTTPStatus403Exception('Invalid URL signature: ' . $e->getMessage());
        }

        $service = strtoupper($proxy_query->getServiceType());
        $errorMessagePrefix = "OwsProxyController->entryPointAction {$service}";
        $this->logger->debug("OwsProxyController->entryPointAction");
        /** @var EventDispatcherInterface $dispatcher */
        $dispatcher = $this->container->get('event_dispatcher');
        $proxy_config = $this->container->getParameter("owsproxy.proxy");

        switch ($service) {
            case 'WMS':
                $proxy = new WmsProxy($dispatcher, $proxy_config, $proxy_query, $this->logger);
                break;
            case 'WFS':
                $proxy = new WfsProxy($dispatcher, $proxy_config, $proxy_query, 'OWSProxy3', $this->logger);
                break;
            default:
                //@TODO ?
                return $this->exceptionHtml(new \Exception('Unknown Service Type', 404));
        }

        try {
            $browserResponse = $proxy->handle();

            $cookies_req = $request->cookies;
            $response = new Response();
            Utils::setHeadersFromBrowserResponse($response, $browserResponse);
            foreach ($cookies_req as $key => $value) {
                $response->headers->removeCookie($key);
                $response->headers->setCookie(new Cookie($key, $value));
            }
            $content = $browserResponse->getContent();
            $response->setContent($content);
            return $response;
        } catch (\Exception $e) {
            $this->logger->error("{$errorMessagePrefix}: {$e->getCode()} " . $e->getMessage());
            return $this->exceptionHtml($e);
        }
    }
1209042
public function handler(): Response
    {
        $data = $this->validate([
            'remark' => [],
            'driver' => [],
            'host' => [],
            'port' => [],
            'encryption' => [],
            'username' => [],
            'password' => [],
            'sender' => [
                new Email()
            ]
        ]);
        $mailer = Mailer::find($this->getParameter('id'));
        if (!$mailer) {
            throw new HttpForbiddenException();
        }
        $mailer->update($data);
        $this->log('info', 'Update mailer [' . $mailer->getSender() . ']');
        return response();
    }
1361348
protected function handlePost() : HttpResponse
    {
        $fileName   = $this->getRequest()->extractFileName();
        $uploadType = self::UPLOAD_TYPE_NORMAL;

        if (empty($fileName)) {
            return $this->response->send(null, HttpResponse::HTTP_BAD_REQUEST);
        }

        if ( ! $this->verifyUploadSize()) {
            return $this->response->send(null, HttpResponse::HTTP_REQUEST_ENTITY_TOO_LARGE);
        }

        $uploadKey = $this->getUploadKey();
        $filePath  = $this->uploadDir . DIRECTORY_SEPARATOR . $fileName;

        if ($this->getRequest()->isFinal()) {
            return $this->handleConcatenation($fileName, $filePath);
        }

        if ($this->getRequest()->isPartial()) {
            $filePath   = $this->getPathForPartialUpload($uploadKey) . $fileName;
            $uploadType = self::UPLOAD_TYPE_PARTIAL;
        }

        $checksum = $this->getClientChecksum();
        $location = $this->getRequest()->url() . $this->getApiPath() . '/' . $uploadKey;

        $file = $this->buildFile([
            'name' => $fileName,
            'offset' => 0,
            'size' => $this->getRequest()->header('Upload-Length'),
            'file_path' => $filePath,
            'location' => $location,
        ])->setKey($uploadKey)->setChecksum($checksum);

        $this->cache->set($uploadKey, $file->details() + ['upload_type' => $uploadType]);

        $this->event()->dispatch(
            UploadCreated::NAME,
            new UploadCreated($file, $this->getRequest(), $this->getResponse())
        );

        return $this->response->send(
            null,
            HttpResponse::HTTP_CREATED,
            [
                'Location' => $location,
                'Upload-Expires' => $this->cache->get($uploadKey)['expires_at'],
            ]
        );
    }
1241426
public function handle(Request $request)
	{
		// execute response
		$response = $this->next($request);

		// check for presence of callback param
		// if we have one lets replace response content with a function executing the 
		// current response content
		if ($callback = $request->getVar('callback', null))
		{
			$response->headers->set('content-type', 'application/javascript');
			$response->setContent(sprintf('%s(%s);', $callback, $response->getContent()));
		}

		// return response
		return $response;
	}
214392
public function handle(Request $request)
    {
        $response = new Response();
        $response = $this->executePassiveActions($request, $response);
        $response = $this->executeAction($request, $response);

        if ($response->isClientError() || $response->isServerError()) {
            return $this->handleError($request, $response);
        }

        return $response;
    }
1229018
public function handle(Request $request)
    {
        try {
            $this->loadConfiguration();

            // Now that Configuration is loaded let's resolve controller
            // for given request.
            $calls = $this->resolveController($request);
            $controller = $calls['controller'];
            $callable   = $calls['callable'];

            // Resolve arguments before calling controller
            $res = $controller->$callable();

            // Check if controller returned Response
            // and if so let's use it as our response
            if (is_a($res, 'Symfony\Component\HttpFoundation\Response')) {
                $this->response = $res;
            }

        } catch (\Exception $e) {
            $error = new \StdClass;
            $error->message = $e->getMessage();
            $error->code    = $e->getCode();
            $this->response->setStatusCode($e->getCode());
            $this->response->setContent(json_encode($error));
            $this->response->headers->set('Content-Type', 'application/json');
        }

        // Send response
        if ($request->getRequestFormat() == 'json') {
            $this->response->headers->set('Content-Type', 'application/json');
        }

        $this->response->send();

    }
999442
public function serve()
    {
        $this->applyMiddleware();

        $requestMethod = $this->getRequest()->method();

        if ( ! in_array($requestMethod, $this->getRequest()->allowedHttpVerbs())) {
            return $this->response->send(null, HttpResponse::HTTP_METHOD_NOT_ALLOWED);
        }

        $clientVersion = $this->getRequest()->header('Tus-Resumable');

        if ($clientVersion && $clientVersion !== self::TUS_PROTOCOL_VERSION) {
            return $this->response->send(null, HttpResponse::HTTP_PRECONDITION_FAILED, [
                'Tus-Version' => self::TUS_PROTOCOL_VERSION,
            ]);
        }

        $method = 'handle' . ucfirst(strtolower($requestMethod));

        return $this->{$method}();
    }
416082
protected function handlePatch() : HttpResponse
    {
        $uploadKey = $this->request->key();

        if ( ! $meta = $this->cache->get($uploadKey)) {
            return $this->response->send(null, HttpResponse::HTTP_GONE);
        }

        $status = $this->verifyPatchRequest($meta);

        if (HttpResponse::HTTP_OK !== $status) {
            return $this->response->send(null, $status);
        }

        $file     = $this->buildFile($meta);
        $checksum = $meta['checksum'];

        try {
            $fileSize = $file->getFileSize();
            $offset   = $file->setKey($uploadKey)->setChecksum($checksum)->upload($fileSize);

            // If upload is done, verify checksum.
            if ($offset === $fileSize) {
                if ( ! $this->verifyChecksum($checksum, $meta['file_path'])) {
                    return $this->response->send(null, self::HTTP_CHECKSUM_MISMATCH);
                }

                $this->event()->dispatch(
                    UploadComplete::NAME,
                    new UploadComplete($file, $this->getRequest(), $this->getResponse())
                );
            } else {
                $this->event()->dispatch(
                    UploadProgress::NAME,
                    new UploadProgress($file, $this->getRequest(), $this->getResponse())
                );
            }
        } catch (FileException $e) {
            return $this->response->send($e->getMessage(), HttpResponse::HTTP_UNPROCESSABLE_ENTITY);
        } catch (OutOfRangeException $e) {
            return $this->response->send(null, HttpResponse::HTTP_REQUESTED_RANGE_NOT_SATISFIABLE);
        } catch (ConnectionException $e) {
            return $this->response->send(null, HttpResponse::HTTP_CONTINUE);
        }

        return $this->response->send(null, HttpResponse::HTTP_NO_CONTENT, [
            'Content-Type' => self::HEADER_CONTENT_TYPE,
            'Upload-Expires' => $this->cache->get($uploadKey)['expires_at'],
            'Upload-Offset' => $offset,
        ]);
    }
275979
public function handle()
    {
        // get information about the REST-request
        $this->get();

        if ($this->requestMethod === 'GET' && $this->typo3Cache->hasCacheEntry($this->url, $_GET)) {
            return $this->handleRequestByTypo3Cache();
        }

        // if no cache exist: restler should handle the request
        if (Defaults::$useVendorMIMEVersioning) {
            $this->responseFormat = $this->negotiateResponseFormat();
        }
        $this->route();
        $this->negotiate();
        $this->preAuthFilter();
        $this->authenticate();
        $this->postAuthFilter();
        $this->validate();
        $this->preCall();
        $this->call();
        $this->compose();
        $this->postCall();

        if ($this->responseFormat instanceof JsonFormat) {
            // return stdClass-object (instead of an array)
            return $this->getRestApiJsonFormat()->decode($this->responseData);
        }
        return $this->responseFormat->decode($this->responseData);
    }
1033775
public static function handleCurrentRequest() {
		try {
			HTTPRoute::initialize();
			static::$mainRequest = static::generateFromEnvironment();
			$response = static::$mainRequest->process();
		} catch( \Exception $e ) {
			$response = HTMLHTTPResponse::generateFromException($e);
		}
		$response->process();
		die();
	}
405981
public function handleRequest()
    {
        // Create the request very early so the ResourceManagement has a chance to grab it:
        $request = Request::createFromEnvironment();
        $response = new Response();
        $this->componentContext = new ComponentContext($request, $response);

        $this->boot();
        $this->resolveDependencies();
        $response = $this->addPoweredByHeader($response);
        $this->componentContext->replaceHttpResponse($response);
        $baseUriSetting = $this->bootstrap->getObjectManager()->get(ConfigurationManager::class)->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Neos.Flow.http.baseUri');
        if (!empty($baseUriSetting)) {
            $baseUri = new Uri($baseUriSetting);
            $request = $request->withAttribute(Request::ATTRIBUTE_BASE_URI, $baseUri);
            $this->componentContext->replaceHttpRequest($request);
        }

        $this->baseComponentChain->handle($this->componentContext);
        $response = $this->baseComponentChain->getResponse();

        $response->send();

        $this->bootstrap->shutdown(Bootstrap::RUNLEVEL_RUNTIME);
        $this->exit->__invoke();
    }
1222191
public static function handleRequest() {
        $response = get_response();
        try {
            $routes = self::$routes->getRoutes();
            if (!empty($routes)) {
                $beforeRoutes = self::$beforeRoutes->getRoutes();
                if (!empty($beforeRoutes)) {
                    foreach ($beforeRoutes as $beforeRoute) {
                        self::executeAction($beforeRoute->getAction(), array_merge($_REQUEST, $beforeRoute->getParameters()));
                    }
                }

                try {
                    foreach ($routes as $route) {
                        $routeResult = self::executeAction($route->getAction(), array_merge($_REQUEST, $route->getParameters()));
                        if (isset($routeResult)) {
                            $response->content($routeResult);
                        }
                    }
                    $afterRoutes = self::$afterRoutes->getRoutes();
                    if (!empty($afterRoutes)) {
                        foreach ($afterRoutes as $afterRoute) {
                            $routeResult = self::executeAction($afterRoute->getAction(), array_merge($_REQUEST, $afterRoute->getParameters()));
                            if (isset($routeResult)) {
                                $response->content($routeResult);
                            }
                        }
                    }
                    $response->send();
                }
                catch (ActionNotFoundException $notFoundException) {
                    self::handleRequestNotFound();
                }
            }
            else {
                self::handleRequestNotFound();
            }
        }
        catch (Throwable $ex) {
            self::handleRequestException($ex);
        }
    }
1341360
public function handle($request)
	{
		$entity = $this->repository()->findById($request->getId());

        $this->authorize($request, $entity);

        if ($relatedEntity = $this->getProperty($entity, $this->field())) {
            return $this->response()->resource($request,
                new Item($relatedEntity, $this->transformer())
            );
        }

        return $this->response()->resource($request, new NullResource());
	}
235860
public function handle($request)
    {
        $entity = $this->repository()->findById($request->getId());

        $this->authorize($request, $entity);

        $this->setProperty($entity, $this->field(), null);

        $this->repository()->getEntityManager()->flush($entity);

        return $this->response()->noContent();
    }
61911
public function toSymfonyResponse() {
    $headers = array_merge(
      array('Content-Type' => Constants::MIME_TYPE),
      $this->getHeaders()
    );
    return new \Symfony\Component\HttpFoundation\Response(
      $this->encode(),
      $this->code,
      $headers
    );
  }
784777
public function handler(): Response
    {
        $member = $this->getAuth();
        return response([
            'id' => $member->getId(),
            'username' => $member->getUsername(),
            'role' => [
                'id' => $member->getRole()->getId(),
                'name' => $member->getRole()->getName()
            ],
            'name' => $member->getName()
        ]);
    }
1253107
public function handler(): Response
    {
        $data = $this->validate([
            'role' => []
        ]);
        $member = Member::search($this->getParameter('username'));
        if (!$member) {
            throw new HttpNotFoundException();
        }
        $data['role'] = Role::findBy(['slug' => $data['role']]);
        if (!$data['role']) {
            throw new HttpForbiddenException();
        }
        $member->update($data);
        $this->log('info', 'Update member [' . $member->getUsername() . ']\'s role to [' . $data['role']->getSlug() . ']');
        return response();
    }