[Server] Fix HTTP Transport Header Compliance (#227)

* fix: added the Allow header for bad method status code

* fix code style

---------

Co-authored-by: Tobias Nyholm <tobias.nyholm@gmail.com>
This commit is contained in:
Ridwan Kasim 2026-02-08 15:58:13 +01:00 • committed by GitHub
commit f3ecb2ebd8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -242,6 +242,10 @@ class StreamableHttpTransport extends BaseTransport
->withHeader('Content-Type', 'application/json')
->withBody($this->streamFactory->createStream($payload));
if (405 === $statusCode) {
$response = $response->withHeader('Allow', 'POST, DELETE, OPTIONS');
}
return $this->withCorsHeaders($response);
}