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

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

@return \Psr\Http\Message\ResponseInterface

@author Seven Du <shiweidu@outlook.com>
The middleware process .