public function isPreflightRequest(string $type, $request): bool
    {
        $requestManager = new Request($type, $request);
        switch (strtolower($type)) {
            case 'psr-7':
            case 'laravel':
            case 'symfony':
                $method = $request->getMethod();
                break;

            default:
                $method = strtolower($_SERVER['REQUEST_METHOD']);
                if ($method === 'post') {
                    if ($_method = $requestManager->getHeader('X-HTTP-METHOD-OVERRIDE')) {
                        $method = $_method;
                    }
                }
                break;
        }

        return $this->isCorsRequest($type, $request)
            && 'options' === strtolower($method)
            && $requestManager->getHeader('Access-Control-Request-Method');
    }