protected function handleCorsPreflightRequest()
    {
        // Automatic CORS preflight response
        $existing_verbs = array();
        foreach (HttpMethods::getAllMethods() as $http_verb) {
            if (isset($this->map[$http_verb])) {
                $urls = $this->map[$http_verb];

                foreach (array_keys($urls) as $url) {
                    if (strstr($url, '$')) {
                        $matches = $this->matchRequestUriWithMap($this->getPath(), $url);

                        if (count($matches) > 0) {
                            $existing_verbs[] = $http_verb;
                            break;
                        }
                    } elseif (isset($this->map[$http_verb][$this->getPath()])) {
                        $existing_verbs[] = $http_verb;
                        break;
                    }
                }
            }
        }
        // OPTIONS is always part of the allowed methods
        $existing_verbs[] = HttpMethods::OPTIONS;

        // RFC5789: PATCH verb OPTIONS response
        // RFC4180: "Spaces are considered part of a field and should not be ignored."
        $comma_devider = ',';
        $this->header_manager->addHeader('Allow', join($comma_devider, $existing_verbs));

        // CORS Headers
        // Access-Control-Allow-Origin will be handled in ::handle()
        $this->header_manager->addHeader('Access-Control-Allow-Methods', join($comma_devider, $existing_verbs));
        $this->header_manager->addHeader('Access-Control-Max-Age', intval($this->cors_max_age));
        if (count($this->cors_allowed_headers) > 0) {
            $this->header_manager->addHeader('Access-Control-Allow-Headers',
                join($comma_devider, $this->cors_allowed_headers));
        }

        $this->sendData('');
    }