/** * No match on route has occurred. Check the HTTP verb used for an options response * Returns true if it is, and option information was successfully written to the response object * @return boolean $success */ protected function doOptionsCheck() { if ($this->request->getHttpMethod() != Request::METHOD_OPTIONS) { return false; } // Do a match on all routes - don't include a verb check $verbs = array(); foreach ($this->getMatchedRoutes(false) as $route) { /* @var RouteMetaData $route */ $allowedOptions = $route->isAllowedOptionRequest(); if (false === ($allowedOptions === -1 ? $this->config->getAllowOptionsRequest() : (bool) $allowedOptions)) { continue; } $verbs = array_merge($verbs, $route->getVerbs()); } if (empty($verbs)) { return false; } $this->response->setHttpHeader('Allow', implode(', ', $verbs)); return true; }