/** * Get a route (if necessary) that responds when other available methods are present. * * @param \Http\Request $request * @param array $others * @return \Routing\Route * * @throws \Symfony\Component\Routing\Exception\MethodNotAllowedHttpException */ protected function getOtherMethodsRoute($request, array $others) { if ($request->method() == 'OPTIONS') { return new Route('OPTIONS', $request->path(), function () use($others) { return new Response('', 200, array('Allow' => implode(',', $others))); }); } $this->methodNotAllowed($others); }