Skip to content

Commit ff09e13

Browse files
committed
fix: added the Allow header for bad method status code
1 parent e485fde commit ff09e13

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Server/Transport/StreamableHttpTransport.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ protected function createErrorResponse(Error $jsonRpcError, int $statusCode): Re
242242
->withHeader('Content-Type', 'application/json')
243243
->withBody($this->streamFactory->createStream($payload));
244244

245+
if (405 === $statusCode) {
246+
$response = $response->withHeader('Allow', 'POST, DELETE, OPTIONS');
247+
}
248+
245249
return $this->withCorsHeaders($response);
246250
}
247251

0 commit comments

Comments
 (0)