private function makeMethodNotAllowedResponse(array $methods, Request $request): Promise {
        return call(function () use ($methods, $request) {
            /** @var \Amp\Http\Server\Response $response */
            $response = yield $this->errorHandler->handleError(Status::METHOD_NOT_ALLOWED, null, $request);
            $response->setHeader("allow", \implode(", ", $methods));
            return $response;
        });
    }