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));
    }
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));
    }
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 ) ) ; }
The middleware handler.

@param \Psr\Http\Message\ServerRequestInterface $request
@param \Psr\Http\Server\RequestHandlerInterface $handler

@return \Psr\Http\Message\ResponseInterface
The middleware handler .