diff --git a/src/Server/Transport/StreamableHttpTransport.php b/src/Server/Transport/StreamableHttpTransport.php index 2b1e6869..d93110e9 100644 --- a/src/Server/Transport/StreamableHttpTransport.php +++ b/src/Server/Transport/StreamableHttpTransport.php @@ -242,6 +242,10 @@ protected function createErrorResponse(Error $jsonRpcError, int $statusCode): Re ->withHeader('Content-Type', 'application/json') ->withBody($this->streamFactory->createStream($payload)); + if ($statusCode === 405) { + $response = $response->withHeader('Allow', 'POST, DELETE, OPTIONS'); + } + return $this->withCorsHeaders($response); }